Skip to content

Commit

Permalink
Merge pull request #100 from dgw/pre_expand-signal
Browse files Browse the repository at this point in the history
Add pre_expand signal for filtering tidbits
  • Loading branch information
dgw authored May 16, 2017
2 parents 4f71f82 + 5f17ad6 commit 93d2cb5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bucket.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3063,6 +3063,8 @@ sub sql {
sub expand {
my ( $who, $chl, $msg, $editable, $to ) = @_;

return if &signal_plugin( "pre_expand", {tidbit => \$msg} );

my $gender = $stats{users}{genders}{lc $who};
my $target = $who;
while ( $msg =~ /(?<!\\)(\$who\b|\${who})/i ) {
Expand Down
1 change: 1 addition & 0 deletions plugins/README
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Bucket plugins:
- "on_notice", { who, msg } - when seeing a notice
- "on_public", \%bag - on public messages
- "on_topic": { chl, topic } - when topic is changed
- "pre_expand": { \$msg } - before variables are interpolated in tidbit
- "say", { chl, text } - when WE say anything
- "start", {} - called on boot

Expand Down

0 comments on commit 93d2cb5

Please sign in to comment.