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
This commit is contained in:
parent
e9d36af595
commit
f2bfbe252c
@ -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("<iq type=\"reply\" id=\"{$xml->attrs['id']}\" to=\"{$xml->attrs['from']}\" />");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user