X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=Uplink%2FP10_User.class.php;h=552c3e45fc63e7c09a7263c728857b87e0a7fce1;hb=7fcecdafa29b6fee35d4d84534b3f74bfbd0d39d;hp=cd3a485d51a0426da735778705c985cd46bdb9c0;hpb=b692377ffd5176e4be4394997c149773eb9405f7;p=PHP-P10.git diff --git a/Uplink/P10_User.class.php b/Uplink/P10_User.class.php index cd3a485..552c3e4 100644 --- a/Uplink/P10_User.class.php +++ b/Uplink/P10_User.class.php @@ -55,6 +55,10 @@ class P10_User { return NULL; } + public static function getAllUsers() { + return self::$static_users; + } + private $numeric; private $server; @@ -65,7 +69,8 @@ class P10_User { private $connect_time; private $modes; private $realname; - private $channels; + private $channels = array(); + private $away = null; public function __construct($nick, $numeric, $server, $connect_time, $ident, $host, $ip, $realname, $modes) { $this->nick = $nick; @@ -125,8 +130,21 @@ class P10_User { return $this->realname; } + public function setAway($away) { + $this->away = $away; + } + + public function getAway() { + return $this->away; + } + + public function isAway() { + return ($this->away != null); + } + public function quit($reason) { $this->server->delUser($this); + unset(self::$static_users[$this->numeric]); foreach($this->channels as $channel) { $channel->quitUser($this); } @@ -148,6 +166,10 @@ class P10_User { return $this->channels; } + public function getChannelCount() { + return count($this->channels); + } + public function isOnChannel($channel) { return array_key_exists(strtolower($channel->getName()),$this->channels); }