From 6149853b56a26a38f61b79a3600958ba84ac386d Mon Sep 17 00:00:00 2001 From: pk910 Date: Tue, 16 Aug 2011 03:47:59 +0200 Subject: [PATCH] support for multi-target notices ("multicast") --- Uplink/Uplink.class.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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") { -- 2.20.1