From ae40dfe842c034263a49e2dbbde5c19ac9515c19 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 23 Jun 2008 18:36:41 -0400 Subject: add imsettings to menu darcs-hash:20080623223641-34904-2758e19c70026a0c169e99d86481d87b0b4bc79c.gz --- xmppdaemon.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'xmppdaemon.php') diff --git a/xmppdaemon.php b/xmppdaemon.php index e055182c9..aa402b1e2 100644 --- a/xmppdaemon.php +++ b/xmppdaemon.php @@ -58,7 +58,7 @@ class XMPPDaemon { $resource = $matches[3]; return strtolower($node.'@'.$server); } - + function handle() { while(!$this->conn->disconnected) { $payloads = $this->conn->processUntil(array('message', 'presence', @@ -81,6 +81,12 @@ class XMPPDaemon { } function handle_message(&$pl) { + if ($pl['type'] != 'chat') { + return; + } + if (strlen($pl['body']) == 0) { + return; + } $from = $this->normalize_jid($pl['from']); $user = User::staticGet('jabber', $from); if (!$user) { -- cgit v1.2.3-54-g00ecf