570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
|
if ([delegate respondsToSelector: @selector(connection:didReceiveIQ:)])
handled = [delegate connection: self
didReceiveIQ: iq];
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];
}
}
- (void)XMPP_handleMessage: (XMPPMessage*)message
{
if ([delegate respondsToSelector:
@selector(connection:didReceiveMessage:)])
|
<
<
<
|
<
<
<
<
<
<
<
<
|
<
<
<
<
|
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
|
if ([delegate respondsToSelector: @selector(connection:didReceiveIQ:)])
handled = [delegate connection: self
didReceiveIQ: iq];
if (!handled && ![[iq type] isEqual: @"error"]
&& ![[iq type] isEqual: @"result"]) {
[self sendStanza: [iq errorIQWithType: @"cancel"
condition: @"service-unavailable"]];
}
}
- (void)XMPP_handleMessage: (XMPPMessage*)message
{
if ([delegate respondsToSelector:
@selector(connection:didReceiveMessage:)])
|