Commit 3fd9e6bd authored by Kiyoshi Aman's avatar Kiyoshi Aman
Browse files

Twitter: move reply-ability to tags, clean up reference tags

parent eb8fe93a
......@@ -94,12 +94,17 @@ sub get {
$on_info->($self->process_tweet($json));
}
our %tags = (
quoted => 'quote',
replied_to => 'reply',
);
sub process_tweet {
my $self = shift;
my ($tweet) = @_;
# handle (displayname verified?): text Posted: datetime Mode: mode
my $fmt = '%s (%s): %s %s: %s %s: %s';
my $fmt = '%s (%s): %s %s: %s';
my $text = $tweet->{data}{text};
my $aid = $tweet->{data}{author_id};
......@@ -153,9 +158,14 @@ sub process_tweet {
}
if (exists($tweet->{data}{referenced_tweets})) {
for my $ref (@{$tweet->{data}{referenced_tweets}}) {
push @flags, $ref->{type};
push @flags, (exists($tags{$ref->{type}}) ? $tags{$ref->{type}} : $ref->{type});
}
}
if ($mode eq 'mentionedUsers') {
push @flags, 'reply🔒mentions';
} elsif ($mode eq 'following') {
push @flags, 'reply🔒followers';
}
@flags = uniqstr(@flags);
if (@flags > 0) {
......@@ -167,7 +177,6 @@ sub process_tweet {
$screen . ($vbool ? " $green$verify$end" : " $red$verify$end"),
$text,
"${bold}Posted$end", $posted,
"${bold}Replies$end", $mode,
);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment