From: pk910 Date: Tue, 16 Aug 2011 01:47:59 +0000 (+0200) Subject: support for multi-target notices ("multicast") X-Git-Url: http://git.pk910.de/?p=PHP-P10.git;a=commitdiff_plain;h=6149853b56a26a38f61b79a3600958ba84ac386d support for multi-target notices ("multicast") --- diff --git a/Uplink/Uplink.class.php b/Uplink/Uplink.class.php index a5cc2eb..e2c2c03 100644 --- a/Uplink/Uplink.class.php +++ b/Uplink/Uplink.class.php @@ -521,7 +521,7 @@ class Uplink { private function recv_privmsg($from, $args) { $user = P10_User::getUserByNum($from); if($user == null) { - trigger_error("Server tries to send a privmsg from an user that does not exist or was not found on recv_privmsg.", E_USER_ERROR); + trigger_error("Server tries to send a privmsg from an user that does not exist or was not found on recv_privmsg.", E_USER_WARNING); return; } if($this->eventHandler) { @@ -538,10 +538,13 @@ class Uplink { $this->eventHandler->event_chanctcp($user, $channel, strtoupper($ctcpexp[0]), (count($ctcpexp) > 1 ? $ctcpexp[1] : null)); } else $this->eventHandler->event_chanmessage($user, $channel, $args[1]); + } else if($args[0][0] == "$") { + //"multicast" + $this->eventHandler->event_privmessage($user, NULL, $args[1]); } else { $targetUser = P10_User::getUserByNum($args[0]); if($targetUser == null) { - trigger_error("Server tries to send a privmsg to an user that does not exist or was not found on recv_privmsg.", E_USER_ERROR); + trigger_error("Server tries to send a privmsg to an user that does not exist or was not found on recv_privmsg.", E_USER_WARNING); return; } if(strlen($args[1]) > 0 && $args[1][0] == "\001") { @@ -560,7 +563,7 @@ class Uplink { private function recv_notice($from, $args) { $user = P10_User::getUserByNum($from); if($user == null) { - trigger_error("Server tries to send a notice from an user that does not exist or was not found on recv_notice.", E_USER_ERROR); + trigger_error("Server tries to send a notice from an user that does not exist or was not found on recv_notice.", E_USER_WARNING); return; } if($this->eventHandler) { @@ -577,10 +580,13 @@ class Uplink { $this->eventHandler->event_chanctcpreply($user, $channel, strtoupper($ctcpexp[0]), (count($ctcpexp) > 1 ? $ctcpexp[1] : null)); } else $this->eventHandler->event_channotice($user, $channel, $args[1]); + } else if($args[0][0] == "$") { + //"multicast" + $this->eventHandler->event_privnotice($user, NULL, $args[1]); } else { $targetUser = P10_User::getUserByNum($args[0]); if($targetUser == null) { - trigger_error("Server tries to send a notice to an user that does not exist or was not found on recv_notice.", E_USER_ERROR); + trigger_error("Server tries to send a notice to an user that does not exist or was not found on recv_notice.", E_USER_WARNING); return; } if(strlen($args[1]) > 0 && $args[1][0] == "\001") {