Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 9 additions and 4 deletions.
  1. +9 −4 ttytter-r2a.pl
View
13 ttytter-r2a.pl
@@ -10,7 +10,7 @@
#
###################
-$TTYtter_R2A_VERSION='1.0';
+$TTYtter_R2A_VERSION='1.0.1';
$addaction = sub {
my @command = split(/ /,$_,3);
@@ -39,11 +39,16 @@
my $mentioned;
# We iterate over the string because I can't think of a better way
while ( $reply_tweet =~ m/(@\w+)/g ) {
+ # Save the lowercased name in a variable to avoid multiple lc
+ # invokations and to make the m// below cleaner.
+ my $reply_target = lc($1);
# Don't add yourself to the reply list, or the person you're
# replying to, since they'll be added anyway
- unless ( ( lc($1) eq lc("\@$whoami") ) ||
- ( lc($1) eq lc("\@$screen_name") ) ) {
- $mentioned .= "$1 ";
+ # Also try to filter out duplicate references to the same user
+ unless ( ( $reply_target eq lc("\@$whoami") ) ||
+ ( $reply_target eq lc("\@$screen_name") ) ||
+ ( $mentioned =~ m/$reply_target/ ) ) {
+ $mentioned .= "$reply_target ";
}
}

No commit comments for this range

Something went wrong with that request. Please try again.