From f2bfbe252cbfab1b127788a18287d6d6f8dc913f Mon Sep 17 00:00:00 2001 From: gar Date: Fri, 21 Nov 2008 09:21:05 +0000 Subject: [PATCH] Removed unneeded addIqHandler made roster_iq_handler reply to type='set' queries git-svn-id: svn://netflint.net/xmpphp@66 ef36c318-a008-4979-b6e8-6b496270793b --- XMPPHP/XMPP.php | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/XMPPHP/XMPP.php b/XMPPHP/XMPP.php index 2b1fc9a..ff4852c 100644 --- a/XMPPHP/XMPP.php +++ b/XMPPHP/XMPP.php @@ -147,20 +147,6 @@ class XMPPHP_XMPP extends XMPPHP_XMLStream { $this->auto_subscribe = $autoSubscribe; } - /** - * Specialized addHandler for iq packets - * - * @param string $tagname - * @param string $ns - * @param string $pointer - * @param string $obj - */ - public function addIqHandler($tagname, $ns, $pointer, $obj = null) { - #TODO make this use addXPathHandler once that's written - # {jabber:client}iq/{$ns}$tagname - //$this->addHandler('iq', $ns, $pointer, $obj, 2); - } - /** * Send XMPP Message * @@ -337,8 +323,6 @@ class XMPPHP_XMPP extends XMPPHP_XMLStream { * @param string $xml */ protected function roster_iq_handler($xml) { - // TODO: make this work - // TODO: reply if it's a type='set' $status = "result"; $xmlroster = $xml->sub('query'); foreach($xmlroster->subs as $item) { @@ -362,10 +346,8 @@ class XMPPHP_XMPP extends XMPPHP_XMLStream { $this->roster->addContact($contact[0], $contact[1], $contact[2], $contact[3]); } } - if ($xml->attrs['type'] == 'set' and $status == 'result') { - #TODO send back result - } elseif ($xml->attrs['type'] == 'set') { - #TODO send back error + if ($xml->attrs['type'] == 'set') { + $this->send("attrs['id']}\" to=\"{$xml->attrs['from']}\" />"); } }