Skip to content

Commit 0357ee5

Browse files
authored
Merge pull request #362 from taboege/tellable-ctcp-action
Tellable: format CTCP ACTION
2 parents 9c25608 + a600ecb commit 0357ee5

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

xbin/Tellable.p6

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,13 @@ multi method irc-to-me($msg where { m:r/^ \s* [seen \s+]?
131131
return I haven't seen $who around
132132
~ maybe , did you mean %s?, did-you-mean-seen $who, %seen
133133
}
134-
I saw $who $entry<timestamp> in $entry<channel>: <$entry<nick>> $entry<text>
134+
135+
# Format CTCP ACTION aka /me
136+
my $said = $entry<text> ~~ /^ \x[01] ‘ACTION ’ <( .* )> \x[01] $/ ??
137+
* $entry<nick> $/ !!
138+
<$entry<nick>> $entry<text>;
139+
140+
I saw $who $entry<timestamp> in $entry<channel>: $said
135141
}
136142

137143
#| tell

xt/tellable.t

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,15 @@ $t.test(‘.seen (normalization, doubled letters)’,
103103
);
104104

105105

106+
# CTCP ACTION
107+
108+
$t.test(:!both, send a /me, \x[01]ACTION waves\x[01]);
109+
110+
$t.test(:!both, .seen a /me,
111+
.seen {$t.our-nick},
112+
/^ <me($t)>‘, I saw ’<me($t)>‘ 2’\S+‘Z in #whateverable_tellable6: * ’<me($t)>‘ waves’ $/
113+
);
114+
106115

107116
# Tell
108117

0 commit comments

Comments
 (0)