358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
|
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
|
-
+
-
+
|
selector: (SEL)selector
{
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
@try {
if (![iq ID])
[iq setID: [self generateStanzaID]];
[callbacks setObject: [XMPPObjectCallback
[callbacks setObject: [XMPPCallback
callbackWithCallbackObject: object
selector: selector]
forKey: [iq ID]];
} @finally {
[pool release];
}
[self sendStanza: iq];
}
#ifdef OF_HAVE_BLOCKS
- (void)sendIQ: (XMPPIQ*)iq
withCallbackBlock: (xmpp_callback_block)callback;
{
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
@try {
if (![iq ID])
[iq setID: [self generateStanzaID]];
[callbacks setObject: [XMPPBlockCallback
[callbacks setObject: [XMPPCallback
callbackWithCallbackBlock: callback]
forKey: [iq ID]];
} @finally {
[pool release];
}
[self sendStanza: iq];
|
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
|
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
|
-
+
|
assert(0);
}
- (void)XMPP_handleIQ: (XMPPIQ*)iq
{
BOOL handled = NO;
id <XMPPCallback> callback;
XMPPCallback *callback;
if ((callback = [callbacks objectForKey: [iq ID]])) {
[callback runWithIQ: iq];
[callbacks removeObjectForKey: [iq ID]];
return;
}
|