modules/ctcp.php
changeset 51 508400fc5282
parent 40 1855846cbdab
equal deleted inserted replaced
50:45164bc2567a 51:508400fc5282
     3 eb_hook('event_ctcp', 'handle_ctcp($ctcp, $params, $message);');
     3 eb_hook('event_ctcp', 'handle_ctcp($ctcp, $params, $message);');
     4 
     4 
     5 function handle_ctcp($ctcp, $params, $message)
     5 function handle_ctcp($ctcp, $params, $message)
     6 {
     6 {
     7   global $irc;
     7   global $irc;
     8   global $alert_list;
     8   global $permissions;
     9   switch($ctcp)
     9   switch($ctcp)
    10   {
    10   {
    11     case 'PING':
    11     case 'PING':
    12       $irc->notice($message['nick'], "\x01PING $params\x01");
    12       $irc->notice($message['nick'], "\x01PING $params\x01");
    13       break;
    13       break;
    18     default:
    18     default:
    19       eval(eb_fetch_hook('event_custom_ctcp'));
    19       eval(eb_fetch_hook('event_custom_ctcp'));
    20       break;
    20       break;
    21   }
    21   }
    22   $now = date('r');
    22   $now = date('r');
    23   foreach ( $alert_list as $alertme )
    23   foreach ( $permissions as $alertme => $perms )
    24   {
    24   {
    25     $irc->privmsg($alertme, "Received CTCP \"$ctcp\" from {$message['nick']}, " . $now);
    25     if ( check_permissions($alertme, array('context' => 'alert')) )
       
    26       $irc->privmsg($alertme, "Received CTCP \"$ctcp\" from {$message['nick']}, " . $now);
    26   }
    27   }
    27 }
    28 }