Make use of the XMPPStanza convenience functions
This commit is contained in:
parent
1f98e7b726
commit
666d710314
1 changed files with 4 additions and 11 deletions
|
@ -419,21 +419,14 @@
|
||||||
didReceiveIQ: iq];
|
didReceiveIQ: iq];
|
||||||
|
|
||||||
if (!handled) {
|
if (!handled) {
|
||||||
OFString *from = [iq attributeForName: @"from"].stringValue;
|
XMPPJID *from = iq.from;
|
||||||
OFString *to = [iq attributeForName: @"to"].stringValue;
|
XMPPJID *to = iq.to;
|
||||||
OFXMLElement *error;
|
OFXMLElement *error;
|
||||||
|
|
||||||
[iq setType: @"error"];
|
[iq setType: @"error"];
|
||||||
|
|
||||||
[iq removeAttributeForName: @"from"];
|
iq.to = from;
|
||||||
[iq removeAttributeForName: @"to"];
|
iq.from = to;
|
||||||
|
|
||||||
if (from != nil)
|
|
||||||
[iq addAttributeWithName: @"to"
|
|
||||||
stringValue: from];
|
|
||||||
if (to != nil)
|
|
||||||
[iq addAttributeWithName: @"from"
|
|
||||||
stringValue: to];
|
|
||||||
|
|
||||||
error = [OFXMLElement elementWithName: @"error"];
|
error = [OFXMLElement elementWithName: @"error"];
|
||||||
[error addAttributeWithName: @"type"
|
[error addAttributeWithName: @"type"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue