From f59524d54130db4250bbfa46e75300af76d02b92 Mon Sep 17 00:00:00 2001 From: pk910 Date: Thu, 28 Jul 2011 06:20:38 +0200 Subject: [PATCH] mode fix --- Bots/IPv6.class.php | 6 ------ Uplink/Uplink.class.php | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Bots/IPv6.class.php b/Bots/IPv6.class.php index 34f1b5c..27f49a6 100644 --- a/Bots/IPv6.class.php +++ b/Bots/IPv6.class.php @@ -83,14 +83,8 @@ class {$_NAME} extends Bot { if(!$this->botOppedOnChannel($channel)) return false; $ipv6 = '/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))(|\/[0-9]{1,3})$/'; if(preg_match($ipv6, $user->getIP())) { - $privs = $channel->getUserPrivs($user); - $privs |= (P10_Channel::USERPRIV_OPED | P10_Channel::USERPRIV_VOICE); - $channel->setUserPrivs($user, $privs); $this->uplink->mode($this->ipv6, $channel, "+ov ".$user->getNumeric()." ".$user->getNumeric()); } else { - $privs = $channel->getUserPrivs($user); - $privs |= (P10_Channel::USERPRIV_VOICE); - $channel->setUserPrivs($user, $privs); $this->uplink->mode($this->ipv6, $channel, "+v ".$user->getNumeric()); } } diff --git a/Uplink/Uplink.class.php b/Uplink/Uplink.class.php index eedc89e..1e8aca0 100644 --- a/Uplink/Uplink.class.php +++ b/Uplink/Uplink.class.php @@ -955,7 +955,7 @@ class Uplink { $channel = P10_Channel::getChannelByName($targetStr); if($channel == null) $channel = new P10_Channel($targetStr); - $modes = $channel->getModes()->setModes($modes); + $modes = $channel->getModes()->setModes($modes, true); if(($this->flags & self::FLAG_CONNECTED)) $this->send(($force ? "OM" : "M"), $user->getNumeric(), $targetStr, $modes); if($this->eventHandler) @@ -964,7 +964,7 @@ class Uplink { $targetUser = P10_User::getUserByNum($targetStr); if($targetUser->getServer() === $this->server) { //just do it :D - $modes = $targetUser->getModes()->setModes($modes); + $modes = $targetUser->getModes()->setModes($modes, true); if(($this->flags & self::FLAG_CONNECTED)) $this->send("M", $targetUser->getNumeric(), $targetUser->getNick(), $modes); if($this->eventHandler) -- 2.20.1