Skip to content

Commit

Permalink
See messages that are sent to other users
Browse files Browse the repository at this point in the history
Using $.NEXT is not enough to make IRC::Client redispatch to another
method. The plugin system seems a bit fragile, but maybe it's because
I'm not using it properly. Anyway, this should now catch more
messages, perhaps with a few (mostly irrelevant) exceptions.
  • Loading branch information
AlexDaniel committed Aug 21, 2019
1 parent 72b3976 commit f564a7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion xbin/Tellable.p6
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ sub normalize-weirdly($nick) {
sub guest-like($nick) { so $nick ~~ /^Guest\d/ }

#| listen for messages and deliver stuff
multi method irc-privmsg-channel($msg) {
multi method irc-privmsg($msg where IRC::Client::Message::Privmsg::Channel) {
return $.NEXT if guest-like $msg.nick;
my $normalized = normalize-weirdly $msg.nick;
$db-seen.read-write: {
Expand Down
5 changes: 5 additions & 0 deletions xt/tellable.t
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,11 @@ $jnthn.send: where => ‘#whateverable_tellable6’, text => ‘hello’;
$t.test(autosend doesn't mistrigger (join),
jnthn: hello,);

$t.test(messages to other users are seen,
.seen {$t.our-nick},
/^ <me($t)>‘, I saw ’<me($t)>‘ 2’\S+‘Z in #whateverable_tellable6: <’<me($t)>‘> jnthn: hello’ $/
);

$t.test(.seen is still working,
.seen jnthn,
/^ <me($t)>‘, I saw jnthn 2’\S+‘Z in #whateverable_tellable6: <jnthn> hello’ $/
Expand Down

0 comments on commit f564a7f

Please sign in to comment.