diff options
| author | 2015-03-07 01:45:14 +0400 | |
|---|---|---|
| committer | 2015-03-07 01:45:14 +0400 | |
| commit | 1fd649a552dbd8910bb79f83163f4a4fdf832d65 (patch) | |
| tree | 67fb0c99fec8e3841eacde66ef87f8a7ffc20bf3 /modules/event.pl | |
| parent | 0015ac246c75892fa43183e30396031e732a3a48 (diff) | |
Add some checks for STATUSMSG prefixes on channels
This un-breaks /msg +#channel hi, mostly.
Diffstat (limited to 'modules/event.pl')
| -rw-r--r-- | modules/event.pl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/event.pl b/modules/event.pl index 05003eb..a1f84de 100644 --- a/modules/event.pl +++ b/modules/event.pl @@ -12,6 +12,7 @@ use HTTP::Request; sub cs { my ($chan) = @_; $chan = lc $chan; + $chan =~ s/^[@+]//; return $::channels->{channel}->{$chan} if ( defined($::channels->{channel}->{$chan}) ); return $::channels->{channel}->{default}; } @@ -329,7 +330,9 @@ sub on_public { my ($conn, $event) = @_; # alarm 200; - $::sc{lc $event->{to}->[0]}{users}{lc $event->{nick}}{msgtime} = time; + my $chan = lc $event->{to}[0]; + $chan =~ s/^[+@]//; + $::sc{$chan}{users}{lc $event->{nick}}{msgtime} = time; $::log->logg( $event ); $::db->logg( $event ); if ($event->{args}->[0] =~ /(https?:\/\/bitly.com\/\w+|https?:\/\/bit.ly\/\w+|https?:\/\/j.mp\/\w+|https?:\/\/tinyurl.com\/\w+)/i) { |
