Skip to content

Commit

Permalink
Fix wrong automatic .tell to bridged users
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexDaniel committed Aug 28, 2019
1 parent 8a573ba commit 0572755
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions xbin/Tellable.p6
Expand Up @@ -17,6 +17,7 @@

use Whateverable;
use Whateverable::Bits;
use Whateverable::Discordable;
use Whateverable::FootgunDB;
use Whateverable::Userlist;

Expand Down Expand Up @@ -66,6 +67,7 @@ multi method irc-privmsg($msg where IRC::Client::Message::Privmsg::Channel) {
channel => $msg.channel,
timestamp => timestampish,
nick => $msg.nick,
bridged => ($msg.nick ~~ FromDiscord).so,
}
}
my %mail = $db-tell.read;
Expand All @@ -91,6 +93,7 @@ multi method irc-privmsg-channel($msg where { m:r/^ \s* $<who>=<.&irc-nick> ‘:
my $normalized = normalize-weirdly $who;
my %seen := $db-seen.read;
return $.NEXT unless %seen{$normalized}:exists; # haven't seen them talk ever
return $.NEXT if %seen{$normalized}<bridged>; # we don't know status of bridged users
# TODO ↓ this should go through all nicknames on the channel
my $previous-nick = %seen{$normalized}<nick>;
return $.NEXT if self.userlist($msg){$previous-nick}; # previous nickname still on the channel
Expand Down

0 comments on commit 0572755

Please sign in to comment.