Add methods to generate error and result replies for IQ stanzas
This commit is contained in:
parent
39d57946d9
commit
7d3796c62f
4 changed files with 77 additions and 21 deletions
|
@ -574,23 +574,8 @@
|
|||
|
||||
if (!handled && ![[iq type] isEqual: @"error"]
|
||||
&& ![[iq type] isEqual: @"result"]) {
|
||||
XMPPJID *from = [iq from];
|
||||
XMPPJID *to = [iq to];
|
||||
OFXMLElement *error;
|
||||
|
||||
[iq setType: @"error"];
|
||||
[iq setTo: from];
|
||||
[iq setFrom: to];
|
||||
|
||||
error = [OFXMLElement elementWithName: @"error"];
|
||||
[error addAttributeWithName: @"type"
|
||||
stringValue: @"cancel"];
|
||||
[error addChild:
|
||||
[OFXMLElement elementWithName: @"service-unavailable"
|
||||
namespace: XMPP_NS_STANZAS]];
|
||||
[iq addChild: error];
|
||||
|
||||
[self sendStanza: iq];
|
||||
[self sendStanza: [iq errorIQWithType: @"cancel"
|
||||
condition: @"service-unavailable"]];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue