Index: src/XMPPConnection.h ================================================================== --- src/XMPPConnection.h +++ src/XMPPConnection.h @@ -147,19 +147,20 @@ OFString *username, *password, *server, *resource; OFString *privateKeyFile, *certificateFile; OFString *domain, *domainToASCII; XMPPJID *JID; uint16_t port; + id dataStorage; OFString *language; XMPPMulticastDelegate *delegates; OFMutableDictionary *callbacks; XMPPAuthenticator *authModule; BOOL streamOpen; BOOL needsSession; BOOL encryptionRequired, encrypted; + BOOL rosterVersioningSupported; unsigned int lastID; - id dataStorage; /// \endcond } #ifdef OF_HAVE_PROPERTIES /// \brief The username to use for authentication @@ -184,18 +185,20 @@ @property (copy) OFString *certificateFile; /// \brief The JID the server assigned to the connection after binding @property (copy, readonly) XMPPJID *JID; /// \brief The port to connect to @property uint16_t port; +/// \brief An object for data storage, conforming to the XMPPStorage protocol +@property (assign) id dataStorage; /// \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 dataStorage; +/// \brief Whether roster versioning is supported +@property (readonly) BOOL rosterVersioningSupported; #endif /** * \brief Creates a new autoreleased XMPPConnection. * Index: src/XMPPConnection.m ================================================================== --- src/XMPPConnection.m +++ src/XMPPConnection.m @@ -347,10 +347,15 @@ - (BOOL)streamOpen { return streamOpen; } + +- (BOOL)rosterVersioningSupported +{ + return rosterVersioningSupported; +} - (BOOL)checkCertificateAndGetReason: (OFString**)reason { X509Certificate *cert; OFDictionary *SANs; @@ -842,10 +847,14 @@ } if (encryptionRequired && !encrypted) /* TODO: Find/create an exception to throw here */ @throw [OFException exceptionWithClass: isa]; + + if ([element elementForName: @"ver" + namespace: XMPP_NS_ROSTERVER] != nil) + rosterVersioningSupported = YES; if (mechs != nil) { OFEnumerator *enumerator; OFXMLElement *mech; Index: src/namespaces.h ================================================================== --- src/namespaces.h +++ src/namespaces.h @@ -21,11 +21,12 @@ */ #define XMPP_NS_BIND @"urn:ietf:params:xml:ns:xmpp-bind" #define XMPP_NS_CLIENT @"jabber:client" #define XMPP_NS_ROSTER @"jabber:iq:roster" +#define XMPP_NS_ROSTERVER @"urn:xmpp:features:rosterver" #define XMPP_NS_SASL @"urn:ietf:params:xml:ns:xmpp-sasl" +#define XMPP_NS_SESSION @"urn:ietf:params:xml:ns:xmpp-session" #define XMPP_NS_STARTTLS @"urn:ietf:params:xml:ns:xmpp-tls" #define XMPP_NS_STANZAS @"urn:ietf:params:xml:ns:xmpp-stanzas" -#define XMPP_NS_SESSION @"urn:ietf:params:xml:ns:xmpp-session" -#define XMPP_NS_XMPP_STREAM @"urn:ietf:params:xml:ns:xmpp-streams" #define XMPP_NS_STREAM @"http://etherx.jabber.org/streams" +#define XMPP_NS_XMPP_STREAM @"urn:ietf:params:xml:ns:xmpp-streams"