X-Git-Url: http://git.pk910.de/?p=PHP-P10.git;a=blobdiff_plain;f=Uplink%2FP10_Channel.class.php;h=0022b623cd2a5cc1dd2dfad1df84d160866d3226;hp=bc8c152f690d086ca9dd36c634643296d14655d8;hb=811bc0c7a1f583fb624a0f8c3601146e063c5a25;hpb=5c6c3365d28144516f0ade183189b256d8de03bc diff --git a/Uplink/P10_Channel.class.php b/Uplink/P10_Channel.class.php index bc8c152..0022b62 100644 --- a/Uplink/P10_Channel.class.php +++ b/Uplink/P10_Channel.class.php @@ -1,22 +1,19 @@ . * * * ************************************************************************ * @@ -24,15 +21,6 @@ * * This class represents a IRC Channel * - ************************************************************************ - * accessable methods: - * - * static P10_User getChannelByName(String $name) - * searches and returns the Channel with the provided name - * - * __construct(String $name) - * *** nothing to say here *** - * */ class P10_Channel { @@ -66,7 +54,8 @@ class P10_Channel { private $create_time; private $users = array(); const USERPRIV_OPED = 0x0001; - const USERPRIV_VOICE = 0x0002; + const USERPRIV_HALFOP = 0x0002; + const USERPRIV_VOICE = 0x0004; private $userPrivs = array(); public function __construct($name) { @@ -106,15 +95,15 @@ class P10_Channel { $user->addChannel($this); } - public function burstUser($user, $opped, $voiced) { + public function burstUser($user, $opped, $halfopped, $voiced) { $this->users[$user->getNumeric()] = $user; - $this->userPrivs[$user->getNumeric()] = ($opped ? self::USERPRIV_OPED : 0) | ($voiced ? self::USERPRIV_VOICE : 0); + $this->userPrivs[$user->getNumeric()] = ($opped ? self::USERPRIV_OPED : 0) | ($halfopped ? self::USERPRIV_HALFOP : 0) | ($voiced ? self::USERPRIV_VOICE : 0); $user->addChannel($this); } private function checkChannel() { if(count($this->users) == 0 && !$this->modes->hasMode('z')) { - unset(self::$static_channels[strtolower($name)]); //drop empty channel + unset(self::$static_channels[strtolower($this->name)]); //drop empty channel } } @@ -153,6 +142,10 @@ class P10_Channel { } } + public function getUserCount() { + return count($this->users); + } + public function getUsers() { return $this->users; }