X-Git-Url: http://git.pk910.de/?p=PHP-P10.git;a=blobdiff_plain;f=Uplink%2FUplink.class.php;h=d90324bf3e6e30bfb08ce5c1e4102c59232e7df5;hp=703a98a7f1a1556cbaf24cdd86e905b1053b4af6;hb=31306844f33ddc639931d9d7173f4af9f7fb327b;hpb=e09078c14e97702b57784db19089acce7789b21f diff --git a/Uplink/Uplink.class.php b/Uplink/Uplink.class.php index 703a98a..d90324b 100644 --- a/Uplink/Uplink.class.php +++ b/Uplink/Uplink.class.php @@ -253,6 +253,9 @@ class Uplink { case "OM": $this->recv_mode($from, $arguments); break; + case "AC": + $this->recv_account($from, $arguments); + break; //default default: //unknown cmd @@ -702,7 +705,7 @@ class Uplink { if($channel == null) $channel = new P10_Channel($args[0]); $channel->getModes()->setModes($modes); - if($this->eventHandler) + if($this->eventHandler && strlen($from) != 2) $this->eventHandler->event_chanmode($user, $channel, $modes); } else { $targetUser = P10_User::getUserByNick($args[0]); @@ -715,6 +718,18 @@ class Uplink { $this->eventHandler->event_usermode($targetUser, $modes); } } + + private function recv_account($from, $args) { + $user = P10_User::getUserByNum($args[0]); + if($user == null) { + trigger_error("Server tries to send an auth announce from an user that does not exist or was not found on recv_account.", E_USER_ERROR); + return; + } + $auth = $args[1]; + $user->getModes()->setModes("+r ".$auth); + if($this->eventHandler) + $this->eventHandler->event_usermode($user, "+r ".$auth); + } /******************************************************************************************** * SERVER FUNCTIONS *