Add capability to register callbacks when sending IQs

This commit is contained in:
Florian Zeitz 2012-01-01 03:42:01 +01:00
parent 7e9672b76f
commit 2f7b349539
5 changed files with 221 additions and 22 deletions

View file

@ -77,11 +77,11 @@
XMPPJID *JID;
uint16_t port;
id <XMPPConnectionDelegate, OFObject> delegate;
OFMutableDictionary *callbacks;
XMPPAuthenticator *authModule;
BOOL needsSession;
BOOL encryptionRequired, encrypted;
unsigned int lastID;
OFString *bindID, *sessionID;
XMPPRoster *roster;
}
@ -158,6 +158,27 @@
*/
- (void)sendStanza: (OFXMLElement*)element;
/**
* Sends an XMPPIQ, registering a callback method
*
* \param object The object that contains the callback method
* \param selector The selector of the callback method,
* must take exactly one parameter of type XMPPIQ*
*/
- (void)sendIQ: (XMPPIQ*)iq
withCallbackObject: (id)object
selector: (SEL)selector;
#ifdef OF_HAVE_BLOCKS
/**
* Sends an XMPPIQ, registering a callback block
*
* \param callback The callback block
*/
- (void)sendIQ: (XMPPIQ*)iq
withCallbackBlock: (void(^)(XMPPIQ*))callback;
#endif
/**
* Generates a new, unique stanza ID.
*