Detect support for roster versioning.

This commit is contained in:
Jonathan Schleifer 2012-02-06 14:49:37 +01:00
parent af04bf7088
commit f6c537a9e9
3 changed files with 18 additions and 5 deletions

View file

@ -149,6 +149,7 @@
OFString *domain, *domainToASCII; OFString *domain, *domainToASCII;
XMPPJID *JID; XMPPJID *JID;
uint16_t port; uint16_t port;
id <XMPPStorage> dataStorage;
OFString *language; OFString *language;
XMPPMulticastDelegate *delegates; XMPPMulticastDelegate *delegates;
OFMutableDictionary *callbacks; OFMutableDictionary *callbacks;
@ -156,8 +157,8 @@
BOOL streamOpen; BOOL streamOpen;
BOOL needsSession; BOOL needsSession;
BOOL encryptionRequired, encrypted; BOOL encryptionRequired, encrypted;
BOOL rosterVersioningSupported;
unsigned int lastID; unsigned int lastID;
id <XMPPStorage> dataStorage;
/// \endcond /// \endcond
} }
@ -186,14 +187,16 @@
@property (copy, readonly) XMPPJID *JID; @property (copy, readonly) XMPPJID *JID;
/// \brief The port to connect to /// \brief The port to connect to
@property uint16_t port; @property uint16_t port;
/// \brief An object for data storage, conforming to the XMPPStorage protocol
@property (assign) id <XMPPStorage> dataStorage;
/// \brief The socket used for the connection /// \brief The socket used for the connection
@property (readonly, retain, getter=socket) OFTCPSocket *sock; @property (readonly, retain, getter=socket) OFTCPSocket *sock;
/// \brief Whether encryption is required /// \brief Whether encryption is required
@property BOOL encryptionRequired; @property BOOL encryptionRequired;
/// \brief Whether the connection is encrypted /// \brief Whether the connection is encrypted
@property (readonly) BOOL encrypted; @property (readonly) BOOL encrypted;
/// \brief An object for data storage, conforming to the XMPPStorage protocol /// \brief Whether roster versioning is supported
@property (assign) id <XMPPStorage> dataStorage; @property (readonly) BOOL rosterVersioningSupported;
#endif #endif
/** /**

View file

@ -350,6 +350,11 @@
return streamOpen; return streamOpen;
} }
- (BOOL)rosterVersioningSupported
{
return rosterVersioningSupported;
}
- (BOOL)checkCertificateAndGetReason: (OFString**)reason - (BOOL)checkCertificateAndGetReason: (OFString**)reason
{ {
X509Certificate *cert; X509Certificate *cert;
@ -845,6 +850,10 @@
/* TODO: Find/create an exception to throw here */ /* TODO: Find/create an exception to throw here */
@throw [OFException exceptionWithClass: isa]; @throw [OFException exceptionWithClass: isa];
if ([element elementForName: @"ver"
namespace: XMPP_NS_ROSTERVER] != nil)
rosterVersioningSupported = YES;
if (mechs != nil) { if (mechs != nil) {
OFEnumerator *enumerator; OFEnumerator *enumerator;
OFXMLElement *mech; OFXMLElement *mech;

View file

@ -23,9 +23,10 @@
#define XMPP_NS_BIND @"urn:ietf:params:xml:ns:xmpp-bind" #define XMPP_NS_BIND @"urn:ietf:params:xml:ns:xmpp-bind"
#define XMPP_NS_CLIENT @"jabber:client" #define XMPP_NS_CLIENT @"jabber:client"
#define XMPP_NS_ROSTER @"jabber:iq:roster" #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_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_STARTTLS @"urn:ietf:params:xml:ns:xmpp-tls"
#define XMPP_NS_STANZAS @"urn:ietf:params:xml:ns:xmpp-stanzas" #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_STREAM @"http://etherx.jabber.org/streams"
#define XMPP_NS_XMPP_STREAM @"urn:ietf:params:xml:ns:xmpp-streams"