X-Git-Url: http://git.pk910.de/?p=PHP-P10.git;a=blobdiff_plain;f=Uplink%2FP10_User.class.php;h=7a6bd0eb8bb4f2c98f0340b87e6c6c6edfaca4ad;hp=ac235b140800c4d37c0a4d5177dfa1f3a24df966;hb=0f30e96ae37491aee19e72b89cc54a6798d1f254;hpb=61ea565f8e0161c0f0f75aac75682941fc2a3611 diff --git a/Uplink/P10_User.class.php b/Uplink/P10_User.class.php index ac235b1..7a6bd0e 100644 --- a/Uplink/P10_User.class.php +++ b/Uplink/P10_User.class.php @@ -1,22 +1,19 @@ . * * * ************************************************************************ * @@ -24,15 +21,6 @@ * * This class represents a IRC User * - ************************************************************************ - * accessable methods: - * - * static P10_User getUserByNum(String $numeric) - * searches and returns the User with the provided Numeric - * - * __construct(String $nick, String $numeric, P10_Server $server, int $connect_time, String $ident, String $realname, P10_ModeSet $modes) - * *** nothing to say here *** - * */ class P10_User { @@ -55,6 +43,10 @@ class P10_User { return NULL; } + public static function getAllUsers() { + return self::$static_users; + } + private $numeric; private $server; @@ -65,7 +57,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 +118,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); } @@ -144,6 +150,14 @@ class P10_User { } } + public function getChannels() { + return $this->channels; + } + + public function getChannelCount() { + return count($this->channels); + } + public function isOnChannel($channel) { return array_key_exists(strtolower($channel->getName()),$this->channels); }