diff options
author | CiaranG <ciaran@ciarang.com> | 2008-08-26 16:00:57 -0400 |
---|---|---|
committer | CiaranG <ciaran@ciarang.com> | 2008-08-26 16:00:57 -0400 |
commit | b6d67b06d45d4fd783e91b1b1aeb17501c6df871 (patch) | |
tree | c5b381af12d61ae2f422df592639bec50788c28e /scripts | |
parent | 28ed51085492aec09d70c2acfee1f1e2a5574968 (diff) |
XMPP daemon that doesn't eat messages - note change to XMPPHP as well (Ticket #551)
darcs-hash:20080826200057-f6e2c-fb9a88251d034824218d20b3fefcde96ddaef827.gz
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/xmppdaemon.php | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/scripts/xmppdaemon.php b/scripts/xmppdaemon.php index 07b8d24e5..c15f28113 100755 --- a/scripts/xmppdaemon.php +++ b/scripts/xmppdaemon.php @@ -96,39 +96,16 @@ class XMPPDaemon { function handle() { - static $parts = array('message', 'presence', - 'end_stream', 'session_start'); - + $this->conn->addEventHandler('message','handle_message',$this); + $this->conn->addEventHandler('presence','handle_presence',$this); while(!$this->conn->isDisconnected()) { - $payloads = $this->conn->processUntil($parts, 10); - - if ($payloads) { - foreach($payloads as $event) { - $pl = $event[1]; - switch($event[0]) { - case 'message': - $this->handle_message($pl); - break; - case 'presence': - $this->handle_presence($pl); - break; - case 'session_start': - $this->handle_session($pl); - break; - } - } - } - + $this->conn->processTime(10); $this->broadcast_queue(); $this->confirmation_queue(); } } - function handle_session($pl) { - # XXX what to do here? - return true; - } function get_user($from) { $user = User::staticGet('jabber', jabber_normalize_jid($from)); |