15 |
15 |
16 function echo_event_privmsg($message) |
16 function echo_event_privmsg($message) |
17 { |
17 { |
18 global $privileged_list; |
18 global $privileged_list; |
19 |
19 |
20 if ( in_array($message['nick'], $privileged_list) && preg_match("/^\!echo-([^\007, \r\n\a\t]+) /", $message['message'], $match) ) |
20 if ( in_array($message['nick'], $privileged_list) && preg_match("/^(?:\!echo-|\/msg )([^\007, \r\n\a\t]+) /", $message['message'], $match) ) |
21 { |
21 { |
22 global $libirc_channels; |
22 global $libirc_channels; |
23 $channel_name =& $match[1]; |
23 $channel_name =& $match[1]; |
24 if ( isset($libirc_channels[$channel_name]) && is_object($libirc_channels[$channel_name]) ) |
24 if ( isset($libirc_channels[$channel_name]) && is_object($libirc_channels[$channel_name]) ) |
25 { |
25 { |
26 $libirc_channels[$channel_name]->msg(eb_censor_words(preg_replace("/^\!echo-([^\007, \r\n\a\t]+) /", '', $message['message'])), true); |
26 $libirc_channels[$channel_name]->msg(eb_censor_words(preg_replace("/^(?:\!echo-|\/msg )((?:#|&)[^\007, \r\n\a\t]+) /", '', $message['message'])), true); |
27 } |
27 } |
28 } |
28 } |
29 else if ( in_array($message['nick'], $privileged_list) && preg_match("/^\!pm ([^\007, \r\n\a\t]+) (.+)/", $message['message'], $match) ) |
29 else if ( in_array($message['nick'], $privileged_list) && preg_match("/^(?:\!pm|\/msg) ([^\007, \r\n\a\t]+) (.+)/", $message['message'], $match) ) |
30 { |
30 { |
31 global $irc; |
31 global $irc; |
32 $irc->privmsg($match[1], eb_censor_words($match[2])); |
32 $irc->privmsg($match[1], eb_censor_words($match[2])); |
33 } |
33 } |
34 } |
34 } |