support for multi-target notices ("multicast")
authorpk910 <philipp@zoelle1.de>
Tue, 16 Aug 2011 01:47:59 +0000 (03:47 +0200)
committerpk910 <philipp@zoelle1.de>
Tue, 16 Aug 2011 01:47:59 +0000 (03:47 +0200)
Uplink/Uplink.class.php

index a5cc2eb74e710831bd2cc1d0d6e8a59cca400d11..e2c2c03cbef4ddb3c538c26682cccfcbc8bb049b 100644 (file)
@@ -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") {