author | Dan |
Tue, 20 Jan 2009 22:08:07 -0500 | |
changeset 51 | 508400fc5282 |
parent 40 | 1855846cbdab |
permissions | -rw-r--r-- |
40 | 1 |
<?php |
2 |
||
3 |
eb_hook('event_ctcp', 'handle_ctcp($ctcp, $params, $message);'); |
|
4 |
||
5 |
function handle_ctcp($ctcp, $params, $message) |
|
6 |
{ |
|
7 |
global $irc; |
|
51
508400fc5282
Major change to permissions backend - performs whois check (only supported blitzed and freenode right now) and advanced permissions supported.
Dan
parents:
40
diff
changeset
|
8 |
global $permissions; |
40 | 9 |
switch($ctcp) |
10 |
{ |
|
11 |
case 'PING': |
|
12 |
$irc->notice($message['nick'], "\x01PING $params\x01"); |
|
13 |
break; |
|
14 |
case 'VERSION': |
|
15 |
global $nick, $enanobot_version; |
|
16 |
$irc->notice($message['nick'], "\x01VERSION $nick-$enanobot_version on PHP/" . PHP_VERSION . " (" . PHP_OS . ")\x01"); |
|
17 |
break; |
|
18 |
default: |
|
19 |
eval(eb_fetch_hook('event_custom_ctcp')); |
|
20 |
break; |
|
21 |
} |
|
22 |
$now = date('r'); |
|
51
508400fc5282
Major change to permissions backend - performs whois check (only supported blitzed and freenode right now) and advanced permissions supported.
Dan
parents:
40
diff
changeset
|
23 |
foreach ( $permissions as $alertme => $perms ) |
40 | 24 |
{ |
51
508400fc5282
Major change to permissions backend - performs whois check (only supported blitzed and freenode right now) and advanced permissions supported.
Dan
parents:
40
diff
changeset
|
25 |
if ( check_permissions($alertme, array('context' => 'alert')) ) |
508400fc5282
Major change to permissions backend - performs whois check (only supported blitzed and freenode right now) and advanced permissions supported.
Dan
parents:
40
diff
changeset
|
26 |
$irc->privmsg($alertme, "Received CTCP \"$ctcp\" from {$message['nick']}, " . $now); |
40 | 27 |
} |
28 |
} |