Overview
Comment: | Add storage to the connection and roster. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
bd076b6bc1e3679ef7cb764978ce5bed |
User & Date: | js on 2012-02-06 13:32:20 |
Other Links: | manifest | tags |
Context
2012-02-06
| ||
13:49 | Detect support for roster versioning. check-in: 284029e0de user: js tags: trunk | |
13:32 | Add storage to the connection and roster. check-in: bd076b6bc1 user: js tags: trunk | |
11:42 | Fix a missing #ifdef HAVE_CONFIG_H. check-in: c18d81fe93 user: js tags: trunk | |
Changes
Modified src/XMPPConnection.h from [0ab968f4e6] to [6d9f63f865].
︙ | ︙ | |||
20 21 22 23 24 25 26 27 28 29 30 31 32 33 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import <ObjFW/ObjFW.h> #import "XMPPCallback.h" @class XMPPConnection; @class XMPPJID; @class XMPPIQ; @class XMPPMessage; @class XMPPPresence; @class XMPPAuthenticator; | > | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import <ObjFW/ObjFW.h> #import "XMPPCallback.h" #import "XMPPStorage.h" @class XMPPConnection; @class XMPPJID; @class XMPPIQ; @class XMPPMessage; @class XMPPPresence; @class XMPPAuthenticator; |
︙ | ︙ | |||
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | XMPPMulticastDelegate *delegates; OFMutableDictionary *callbacks; XMPPAuthenticator *authModule; BOOL streamOpen; BOOL needsSession; BOOL encryptionRequired, encrypted; unsigned int lastID; /// \endcond } #ifdef OF_HAVE_PROPERTIES /// \brief The username to use for authentication @property (copy) OFString *username; /// \brief The password to use for authentication @property (copy) OFString *password; | > > | | 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | XMPPMulticastDelegate *delegates; OFMutableDictionary *callbacks; XMPPAuthenticator *authModule; BOOL streamOpen; BOOL needsSession; BOOL encryptionRequired, encrypted; unsigned int lastID; id <XMPPStorage> dataStorage; /// \endcond } #ifdef OF_HAVE_PROPERTIES /// \brief The username to use for authentication @property (copy) OFString *username; /// \brief The password to use for authentication @property (copy) OFString *password; /** * \brief The server to use for the connection * * This is useful if the address of the server is different from the domain. */ @property (copy) OFString *server; /// \brief The domain to connect to @property (copy) OFString *domain; /// \brief The resource to request for the connection |
︙ | ︙ | |||
185 186 187 188 189 190 191 192 193 194 195 196 197 198 | @property uint16_t port; /// \brief The socket used for the connection @property (readonly, retain, getter=socket) OFTCPSocket *sock; /// \brief Whether encryption is required @property BOOL encryptionRequired; /// \brief Whether the connection is encrypted @property (readonly) BOOL encrypted; #endif /** * \brief Creates a new autoreleased XMPPConnection. * * \return A new autoreleased XMPPConnection */ | > > | 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | @property uint16_t port; /// \brief The socket used for the connection @property (readonly, retain, getter=socket) OFTCPSocket *sock; /// \brief Whether encryption is required @property BOOL encryptionRequired; /// \brief Whether the connection is encrypted @property (readonly) BOOL encrypted; /// \brief An object for data storage, conforming to the XMPPStorage protocol @property (assign) id <XMPPStorage> dataStorage; #endif /** * \brief Creates a new autoreleased XMPPConnection. * * \return A new autoreleased XMPPConnection */ |
︙ | ︙ | |||
322 323 324 325 326 327 328 329 330 331 332 333 334 335 | - (void)setDomain: (OFString*)domain; - (OFString*)domain; - (void)setResource: (OFString*)resource; - (OFString*)resource; - (XMPPJID*)JID; - (void)setPort: (uint16_t)port; - (uint16_t)port; - (void)setLanguage: (OFString*)language; - (OFString*)language; /// \cond internal - (void)XMPP_startStream; - (void)XMPP_handleStream: (OFXMLElement*)element; - (void)XMPP_handleTLS: (OFXMLElement*)element; | > > | 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 | - (void)setDomain: (OFString*)domain; - (OFString*)domain; - (void)setResource: (OFString*)resource; - (OFString*)resource; - (XMPPJID*)JID; - (void)setPort: (uint16_t)port; - (uint16_t)port; - (void)setDataStorage: (id <XMPPStorage>)dataStorage; - (id <XMPPStorage>)dataStorage; - (void)setLanguage: (OFString*)language; - (OFString*)language; /// \cond internal - (void)XMPP_startStream; - (void)XMPP_handleStream: (OFXMLElement*)element; - (void)XMPP_handleTLS: (OFXMLElement*)element; |
︙ | ︙ |
Modified src/XMPPConnection.m from [7e095e71b8] to [1a7d78a099].
︙ | ︙ | |||
32 33 34 35 36 37 38 39 40 41 42 43 44 45 | #include <stringprep.h> #include <idna.h> #import <ObjOpenSSL/SSLSocket.h> #import <ObjOpenSSL/SSLInvalidCertificateException.h> #import <ObjOpenSSL/X509Certificate.h> #import "XMPPConnection.h" #import "XMPPCallback.h" #import "XMPPSRVLookup.h" #import "XMPPEXTERNALAuth.h" #import "XMPPSCRAMAuth.h" #import "XMPPPLAINAuth.h" #import "XMPPStanza.h" | > > | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | #include <stringprep.h> #include <idna.h> #import <ObjOpenSSL/SSLSocket.h> #import <ObjOpenSSL/SSLInvalidCertificateException.h> #import <ObjOpenSSL/X509Certificate.h> #import <ObjFW/OFInvalidArgumentException.h> #import "XMPPConnection.h" #import "XMPPCallback.h" #import "XMPPSRVLookup.h" #import "XMPPEXTERNALAuth.h" #import "XMPPSCRAMAuth.h" #import "XMPPPLAINAuth.h" #import "XMPPStanza.h" |
︙ | ︙ | |||
1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 | port = port_; } - (uint16_t)port { return port; } - (void)setLanguage: (OFString*)language_ { OF_SETTER(language, language_, YES, YES) } - (OFString*)language | > > > > > > > > > > > > > | 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 | port = port_; } - (uint16_t)port { return port; } - (void)setDataStorage: (id <XMPPStorage>)dataStorage_ { if (streamOpen) @throw [OFInvalidArgumentException exceptionWithClass: isa]; dataStorage = dataStorage_; } - (id <XMPPStorage>)dataStorage { return dataStorage; } - (void)setLanguage: (OFString*)language_ { OF_SETTER(language, language_, YES, YES) } - (OFString*)language |
︙ | ︙ |
Modified src/XMPPRoster.h from [963ba59e66] to [d4d891ac82].
︙ | ︙ | |||
20 21 22 23 24 25 26 27 28 29 30 31 32 33 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import <ObjFW/ObjFW.h> #import "XMPPConnection.h" @class XMPPRosterItem; @class XMPPIQ; @class XMPPRoster; @class XMPPMulticastDelegate; /** | > | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import <ObjFW/ObjFW.h> #import "XMPPConnection.h" #import "XMPPStorage.h" @class XMPPRosterItem; @class XMPPIQ; @class XMPPRoster; @class XMPPMulticastDelegate; /** |
︙ | ︙ | |||
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | <XMPPConnectionDelegate> #endif { /// \cond internal XMPPConnection *connection; OFMutableDictionary *rosterItems; XMPPMulticastDelegate *delegates; /// \endcond } /** * \brief Initializes an already allocated XMPPRoster. * * \param connection The connection roster related stanzas * are send and received over * \return An initialized XMPPRoster | > > > > > > > > > > | 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | <XMPPConnectionDelegate> #endif { /// \cond internal XMPPConnection *connection; OFMutableDictionary *rosterItems; XMPPMulticastDelegate *delegates; id <XMPPStorage> dataStorage; /// \endcond } #ifdef OF_HAVE_PROPERTIES /** * \brief An object for data storage, conforming to the XMPPStorage protocol. * * Inherited from the connection if not overridden. */ @property (assign) id <XMPPStorage> dataStorage; #endif /** * \brief Initializes an already allocated XMPPRoster. * * \param connection The connection roster related stanzas * are send and received over * \return An initialized XMPPRoster |
︙ | ︙ | |||
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | /** * \brief Removes the specified delegate. * * \param delegate The delegate to remove */ - (void)removeDelegate: (id <XMPPRosterDelegate>)delegate; /// \cond internal - (void)XMPP_addRosterItem: (XMPPRosterItem*)rosterItem; - (void)XMPP_updateRosterItem: (XMPPRosterItem*)rosterItem; - (void)XMPP_deleteRosterItem: (XMPPRosterItem*)rosterItem; - (void)XMPP_handleInitialRosterForConnection: (XMPPConnection*)connection withIQ: (XMPPIQ*)iq; - (XMPPRosterItem*)XMPP_rosterItemWithXMLElement: (OFXMLElement*)element; /// \endcond @end @interface OFObject (XMPPRosterDelegate) <XMPPRosterDelegate> @end | > > > | 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | /** * \brief Removes the specified delegate. * * \param delegate The delegate to remove */ - (void)removeDelegate: (id <XMPPRosterDelegate>)delegate; - (void)setDataStorage: (id <XMPPStorage>)dataStorage; - (id <XMPPStorage>)dataStorage; /// \cond internal - (void)XMPP_addRosterItem: (XMPPRosterItem*)rosterItem; - (void)XMPP_updateRosterItem: (XMPPRosterItem*)rosterItem; - (void)XMPP_deleteRosterItem: (XMPPRosterItem*)rosterItem; - (void)XMPP_handleInitialRosterForConnection: (XMPPConnection*)connection withIQ: (XMPPIQ*)iq; - (XMPPRosterItem*)XMPP_rosterItemWithXMLElement: (OFXMLElement*)element; /// \endcond @end @interface OFObject (XMPPRosterDelegate) <XMPPRosterDelegate> @end |
Modified src/XMPPRoster.m from [606dc8ad06] to [96a5c55573].
︙ | ︙ | |||
43 44 45 46 47 48 49 50 51 52 53 54 55 56 | self = [super init]; @try { rosterItems = [[OFMutableDictionary alloc] init]; connection = connection_; [connection addDelegate: self]; delegates = [[XMPPMulticastDelegate alloc] init]; } @catch (id e) { [self release]; @throw e; } return self; } | > | 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | self = [super init]; @try { rosterItems = [[OFMutableDictionary alloc] init]; connection = connection_; [connection addDelegate: self]; delegates = [[XMPPMulticastDelegate alloc] init]; dataStorage = [connection dataStorage]; } @catch (id e) { [self release]; @throw e; } return self; } |
︙ | ︙ | |||
180 181 182 183 184 185 186 187 188 189 190 191 192 193 | [delegates addDelegate: delegate]; } - (void)removeDelegate: (id <XMPPRosterDelegate>)delegate { [delegates removeDelegate: delegate]; } - (void)XMPP_addRosterItem: (XMPPRosterItem*)rosterItem { return [self XMPP_updateRosterItem: rosterItem]; } - (void)XMPP_updateRosterItem: (XMPPRosterItem*)rosterItem | > > > > > > > > > > > | 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | [delegates addDelegate: delegate]; } - (void)removeDelegate: (id <XMPPRosterDelegate>)delegate { [delegates removeDelegate: delegate]; } - (void)setDataStorage: (id <XMPPStorage>)dataStorage_ { /* TODO: Prevent changing it after it has been used */ dataStorage = dataStorage_; } - (id <XMPPStorage>)dataStorage { return dataStorage; } - (void)XMPP_addRosterItem: (XMPPRosterItem*)rosterItem { return [self XMPP_updateRosterItem: rosterItem]; } - (void)XMPP_updateRosterItem: (XMPPRosterItem*)rosterItem |
︙ | ︙ |