415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
|
}
if ([delegate respondsToSelector: @selector(connection:didReceiveIQ:)])
handled = [delegate connection: self
didReceiveIQ: iq];
if (!handled) {
OFString *from = [iq attributeForName: @"from"].stringValue;
OFString *to = [iq attributeForName: @"to"].stringValue;
OFXMLElement *error;
[iq setType: @"error"];
[iq removeAttributeForName: @"from"];
[iq removeAttributeForName: @"to"];
if (from != nil)
[iq addAttributeWithName: @"to"
stringValue: from];
if (to != nil)
[iq addAttributeWithName: @"from"
stringValue: to];
error = [OFXMLElement elementWithName: @"error"];
[error addAttributeWithName: @"type"
stringValue: @"cancel"];
[error addChild:
[OFXMLElement elementWithName: @"service-unavailable"
namespace: NS_STANZAS]];
|
|
|
<
<
|
|
<
<
<
<
<
|
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
|
}
if ([delegate respondsToSelector: @selector(connection:didReceiveIQ:)])
handled = [delegate connection: self
didReceiveIQ: iq];
if (!handled) {
XMPPJID *from = iq.from;
XMPPJID *to = iq.to;
OFXMLElement *error;
[iq setType: @"error"];
iq.to = from;
iq.from = to;
error = [OFXMLElement elementWithName: @"error"];
[error addAttributeWithName: @"type"
stringValue: @"cancel"];
[error addChild:
[OFXMLElement elementWithName: @"service-unavailable"
namespace: NS_STANZAS]];
|