diff --git a/src/XMPPAuthenticator.m b/src/XMPPAuthenticator.m index 917d469..0097b5b 100644 --- a/src/XMPPAuthenticator.m +++ b/src/XMPPAuthenticator.m @@ -64,32 +64,32 @@ - (void)setAuthzid: (OFString*)authzid { - OF_SETTER(_authzid, authzid, YES, YES) + OF_SETTER(_authzid, authzid, true, 1) } - (OFString*)authzid { - OF_GETTER(_authzid, YES) + OF_GETTER(_authzid, true) } - (void)setAuthcid: (OFString*)authcid { - OF_SETTER(_authcid, authcid, YES, YES) + OF_SETTER(_authcid, authcid, true, 1) } - (OFString*)authcid { - OF_GETTER(_authcid, YES) + OF_GETTER(_authcid, true) } - (void)setPassword: (OFString*)password { - OF_SETTER(_password, password, YES, YES) + OF_SETTER(_password, password, true, 1) } - (OFString*)password { - OF_GETTER(_password, YES) + OF_GETTER(_password, true) } - (OFDataArray*)initialMessage diff --git a/src/XMPPConnection.h b/src/XMPPConnection.h index 1f3c79e..bbad8d2 100644 --- a/src/XMPPConnection.h +++ b/src/XMPPConnection.h @@ -87,7 +87,7 @@ * \param connection The connection that received the stanza * \param iq The IQ stanza that was received */ -- (BOOL)connection: (XMPPConnection*)connection +- (bool)connection: (XMPPConnection*)connection didReceiveIQ: (XMPPIQ*)iq; /** @@ -166,11 +166,11 @@ XMPPMulticastDelegate *_delegates; OFMutableDictionary *_callbacks; XMPPAuthenticator *_authModule; - BOOL _streamOpen; - BOOL _needsSession; - BOOL _encryptionRequired, _encrypted; - BOOL _supportsRosterVersioning; - BOOL _supportsStreamManagement; + bool _streamOpen; + bool _needsSession; + bool _encryptionRequired, _encrypted; + bool _supportsRosterVersioning; + bool _supportsStreamManagement; unsigned int _lastID; } @@ -204,13 +204,13 @@ /// \brief The socket used for the connection @property (readonly, retain) OFTCPSocket *socket; /// \brief Whether encryption is required -@property BOOL encryptionRequired; +@property bool encryptionRequired; /// \brief Whether the connection is encrypted -@property (readonly) BOOL encrypted; +@property (readonly) bool encrypted; /// \brief Whether roster versioning is supported -@property (readonly) BOOL supportsRosterVersioning; +@property (readonly) bool supportsRosterVersioning; /// \brief Whether stream management is supported -@property (readonly) BOOL supportsStreamManagement; +@property (readonly) bool supportsStreamManagement; #endif /** @@ -253,7 +253,7 @@ * Passing NULL means the reason is not stored anywhere. * \return Whether the certificate is valid */ -- (BOOL)checkCertificateAndGetReason: (OFString**)reason; +- (bool)checkCertificateAndGetReason: (OFString**)reason; /** * \brief Adds the connection to the run loop. @@ -290,21 +290,21 @@ * * \return Whether encryption is encrypted */ -- (BOOL)encryptionRequired; +- (bool)encryptionRequired; /** * \brief Sets whether encryption is required. * * \param required Whether encryption is required */ -- (void)setEncryptionRequired: (BOOL)required; +- (void)setEncryptionRequired: (bool)required; /** * \brief Returns whether the connection is encrypted. * * \return Whether the connection is encrypted */ -- (BOOL)encrypted; +- (bool)encrypted; /** * \brief Sends an OFXMLElement, usually an XMPPStanza. @@ -360,8 +360,8 @@ - (id )dataStorage; - (void)setLanguage: (OFString*)language; - (OFString*)language; -- (BOOL)supportsRosterVersioning; -- (BOOL)supportsStreamManagement; +- (bool)supportsRosterVersioning; +- (bool)supportsStreamManagement; - (void)XMPP_startStream; - (void)XMPP_handleStream: (OFXMLElement*)element; diff --git a/src/XMPPConnection.m b/src/XMPPConnection.m index 9f4ea18..c7b4151 100644 --- a/src/XMPPConnection.m +++ b/src/XMPPConnection.m @@ -108,7 +108,7 @@ [self performSelector: @selector(didConnect) onThread: sourceThread - waitUntilDone: NO]; + waitUntilDone: false]; [pool release]; @@ -128,8 +128,6 @@ @try { _port = 5222; - _encrypted = NO; - _streamOpen = NO; _delegates = [[XMPPMulticastDelegate alloc] init]; _callbacks = [[OFMutableDictionary alloc] init]; } @catch (id e) { @@ -309,22 +307,22 @@ - (void)setPrivateKeyFile: (OFString*)privateKeyFile { - OF_SETTER(_privateKeyFile, privateKeyFile, YES, YES) + OF_SETTER(_privateKeyFile, privateKeyFile, true, 1) } - (OFString*)privateKeyFile { - OF_GETTER(_privateKeyFile, YES) + OF_GETTER(_privateKeyFile, true) } - (void)setCertificateFile: (OFString*)certificateFile { - OF_SETTER(_certificateFile, certificateFile, YES, YES) + OF_SETTER(_certificateFile, certificateFile, true, 1) } - (OFString*)certificateFile { - OF_GETTER(_certificateFile, YES) + OF_GETTER(_certificateFile, true) } - (void)connect @@ -397,13 +395,13 @@ [pool release]; } -- (BOOL)XMPP_parseBuffer: (const void*)buffer +- (bool)XMPP_parseBuffer: (const void*)buffer length: (size_t)length { if ([_socket isAtEndOfStream]) { [_delegates broadcastSelector: @selector(connectionWasClosed:) withObject: self]; - return NO; + return false; } @try { @@ -413,10 +411,10 @@ [self XMPP_sendStreamError: @"bad-format" text: nil]; [self close]; - return NO; + return false; } - return YES; + return true; } - (void)parseBuffer: (const void*)buffer @@ -432,7 +430,7 @@ _oldElementBuilder = nil; } -- (BOOL)stream: (OFStream*)stream +- (bool)stream: (OFStream*)stream didReadIntoBuffer: (char*)buffer length: (size_t)length exception: (OFException*)exception @@ -443,20 +441,20 @@ withObject: self withObject: exception]; [self close]; - return NO; + return false; } @try { if (![self XMPP_parseBuffer: buffer length: length]) - return NO; + return false; } @catch (id e) { [_delegates broadcastSelector: @selector(connection: didThrowException:) withObject: self withObject: e]; [self close]; - return NO; + return false; } if (_oldParser != nil || _oldElementBuilder != nil) { @@ -473,10 +471,10 @@ didReadIntoBuffer:length: exception:)]; - return NO; + return false; } - return YES; + return true; } - (OFTCPSocket*)socket @@ -484,41 +482,41 @@ return [[_socket retain] autorelease]; } -- (BOOL)encryptionRequired +- (bool)encryptionRequired { return _encryptionRequired; } -- (void)setEncryptionRequired: (BOOL)encryptionRequired +- (void)setEncryptionRequired: (bool)encryptionRequired { _encryptionRequired = encryptionRequired; } -- (BOOL)encrypted +- (bool)encrypted { return _encrypted; } -- (BOOL)streamOpen +- (bool)streamOpen { return _streamOpen; } -- (BOOL)supportsRosterVersioning +- (bool)supportsRosterVersioning { return _supportsRosterVersioning; } -- (BOOL)supportsStreamManagement +- (bool)supportsStreamManagement { return _supportsStreamManagement; } -- (BOOL)checkCertificateAndGetReason: (OFString**)reason +- (bool)checkCertificateAndGetReason: (OFString**)reason { X509Certificate *cert; OFDictionary *SANs; - BOOL serviceSpecific = NO; + bool serviceSpecific = false; @try { [_socket verifyPeerCertificate]; @@ -526,7 +524,7 @@ if (reason != NULL) *reason = [[[e reason] copy] autorelease]; - return NO; + return false; } cert = [_socket peerCertificate]; @@ -536,18 +534,18 @@ objectForKey: OID_SRVName] != nil || [SANs objectForKey: @"dNSName"] != nil || [SANs objectForKey: @"uniformResourceIdentifier"] != nil) - serviceSpecific = YES; + serviceSpecific = true; if ([cert hasSRVNameMatchingDomain: _domainToASCII service: @"xmpp-client"] || [cert hasDNSNameMatchingDomain: _domainToASCII]) - return YES; + return true; if (!serviceSpecific && [cert hasCommonNameMatchingDomain: _domainToASCII]) - return YES; + return true; - return NO; + return false; } - (void)sendStanza: (OFXMLElement*)element @@ -723,7 +721,7 @@ @"xmlns:stream='" XMPP_NS_STREAM @"' %@" @"version='1.0'>", _domain, langString]; - _streamOpen = YES; + _streamOpen = true; } - (void)close @@ -742,8 +740,8 @@ _socket = nil; [_JID release]; _JID = nil; - _streamOpen = _needsSession = _encrypted = NO; - _supportsRosterVersioning = _supportsStreamManagement = NO; + _streamOpen = _needsSession = _encrypted = false; + _supportsRosterVersioning = _supportsStreamManagement = false; _lastID = 0; } @@ -893,7 +891,7 @@ [_socket release]; _socket = newSock; - _encrypted = YES; + _encrypted = true; [_delegates broadcastSelector: @selector( connectionDidUpgradeToTLS:) @@ -962,7 +960,7 @@ - (void)XMPP_handleIQ: (XMPPIQ*)iq { - BOOL handled = NO; + bool handled = false; XMPPCallback *callback; if ((callback = [_callbacks objectForKey: [iq ID]])) { @@ -1023,11 +1021,11 @@ if ([element elementForName: @"ver" namespace: XMPP_NS_ROSTERVER] != nil) - _supportsRosterVersioning = YES; + _supportsRosterVersioning = true; if ([element elementForName: @"sm" namespace: XMPP_NS_SM] != nil) - _supportsStreamManagement = YES; + _supportsStreamManagement = true; if (mechs != nil) { OFEnumerator *enumerator; @@ -1050,7 +1048,7 @@ password: _password connection: self hash: [OFSHA1Hash class] - plusAvailable: YES]; + plusAvailable: true]; [self XMPP_sendAuth: @"SCRAM-SHA-1-PLUS"]; return; } @@ -1061,7 +1059,7 @@ password: _password connection: self hash: [OFSHA1Hash class] - plusAvailable: NO]; + plusAvailable: false]; [self XMPP_sendAuth: @"SCRAM-SHA-1"]; return; } @@ -1078,7 +1076,7 @@ } if (session != nil) - _needsSession = YES; + _needsSession = true; if (bind != nil) { [self XMPP_sendResourceBind]; @@ -1256,12 +1254,12 @@ - (void)setLanguage: (OFString*)language { - OF_SETTER(_language, language, YES, YES) + OF_SETTER(_language, language, true, 1) } - (OFString*)language { - OF_GETTER(_language, YES) + OF_GETTER(_language, true) } - (void)addDelegate: (id )delegate diff --git a/src/XMPPContact.m b/src/XMPPContact.m index 8b5ec5b..e3dd4dc 100644 --- a/src/XMPPContact.m +++ b/src/XMPPContact.m @@ -48,12 +48,12 @@ - (XMPPRosterItem*)rosterItem { - OF_GETTER(_rosterItem, YES); + OF_GETTER(_rosterItem, true) } - (OFDictionary*)presences { - OF_GETTER(_presences, YES); + OF_GETTER(_presences, true) } - (void)sendMessage: (XMPPMessage*)message @@ -69,7 +69,7 @@ - (void)XMPP_setRosterItem: (XMPPRosterItem*)rosterItem { - OF_SETTER(_rosterItem, rosterItem, YES, 0); + OF_SETTER(_rosterItem, rosterItem, true, 0); } - (void)XMPP_setPresence: (XMPPPresence*)presence @@ -82,7 +82,7 @@ [_presences setObject: presence forKey: @""]; - OF_SETTER(_lockedOnJID, nil, YES, 0); + [self XMPP_setLockedOnJID: nil]; } - (void)XMPP_removePresenceForResource: (OFString*)resource @@ -94,11 +94,11 @@ _presences = [[OFMutableDictionary alloc] init]; } - OF_SETTER(_lockedOnJID, nil, YES, 0); + [self XMPP_setLockedOnJID: nil]; } - (void)XMPP_setLockedOnJID: (XMPPJID*)JID; { - OF_SETTER(_lockedOnJID, JID, YES, 0); + OF_SETTER(_lockedOnJID, JID, true, 0); } @end diff --git a/src/XMPPContactManager.m b/src/XMPPContactManager.m index 86b8f03..e6fa02d 100644 --- a/src/XMPPContactManager.m +++ b/src/XMPPContactManager.m @@ -86,7 +86,7 @@ - (OFDictionary*)contacts { - OF_GETTER(_contacts, YES); + OF_GETTER(_contacts, true) } - (void)rosterWasReceived: (XMPPRoster*)roster_ diff --git a/src/XMPPDiscoEntity.m b/src/XMPPDiscoEntity.m index 2f73daf..c2b42ee 100644 --- a/src/XMPPDiscoEntity.m +++ b/src/XMPPDiscoEntity.m @@ -74,7 +74,7 @@ - (OFDictionary*)discoNodes; { - OF_GETTER(_discoNodes, YES); + OF_GETTER(_discoNodes, true) } - (void)addDiscoNode: (XMPPDiscoNode*)node @@ -85,7 +85,7 @@ - (OFString*)capsNode { - OF_GETTER(_capsNode, YES); + OF_GETTER(_capsNode, true) } - (OFString*)capsHash @@ -121,11 +121,11 @@ _JID = [JID copy]; } -- (BOOL)connection: (XMPPConnection*)connection +- (bool)connection: (XMPPConnection*)connection didReceiveIQ: (XMPPIQ*)IQ { if (![[IQ to] isEqual: _JID]) - return NO; + return false; OFXMLElement *query = [IQ elementForName: @"query" namespace: XMPP_NS_DISCO_ITEMS]; @@ -142,7 +142,7 @@ return [responder XMPP_handleItemsIQ: IQ connection: connection]; - return NO; + return false; } query = [IQ elementForName: @"query" @@ -167,9 +167,9 @@ return [responder XMPP_handleInfoIQ: IQ connection: connection]; - return NO; + return false; } - return NO; + return false; } @end diff --git a/src/XMPPDiscoIdentity.m b/src/XMPPDiscoIdentity.m index 31d8cbc..af5d042 100644 --- a/src/XMPPDiscoIdentity.m +++ b/src/XMPPDiscoIdentity.m @@ -91,17 +91,17 @@ - (OFString*)category { - OF_GETTER(_category, YES); + OF_GETTER(_category, true) } - (OFString*)name { - OF_GETTER(_name, YES); + OF_GETTER(_name, true) } - (OFString*)type { - OF_GETTER(_type, YES); + OF_GETTER(_type, true) } - (bool)isEqual: (id)object @@ -109,22 +109,22 @@ XMPPDiscoIdentity *identity; if (object == self) - return YES; + return true; if (![object isKindOfClass: [XMPPDiscoIdentity class]]) - return NO; + return false; identity = object; if ([_category isEqual: identity->_category] && (_name == identity->_name || [_name isEqual: identity->_name]) && [_type isEqual: identity->_type]) - return YES; + return true; - return NO; + return false; } -- (uint32_t) hash +- (uint32_t)hash { uint32_t hash; diff --git a/src/XMPPDiscoNode.h b/src/XMPPDiscoNode.h index 2959812..4465a7b 100644 --- a/src/XMPPDiscoNode.h +++ b/src/XMPPDiscoNode.h @@ -128,8 +128,8 @@ - (OFSortedList*)features; - (OFDictionary*)childNodes; -- (BOOL)XMPP_handleItemsIQ: (XMPPIQ*)IQ +- (bool)XMPP_handleItemsIQ: (XMPPIQ*)IQ connection: (XMPPConnection*)connection; -- (BOOL)XMPP_handleInfoIQ: (XMPPIQ*)IQ +- (bool)XMPP_handleInfoIQ: (XMPPIQ*)IQ connection: (XMPPConnection*)connection; @end diff --git a/src/XMPPDiscoNode.m b/src/XMPPDiscoNode.m index 068b5d9..320915b 100644 --- a/src/XMPPDiscoNode.m +++ b/src/XMPPDiscoNode.m @@ -94,32 +94,32 @@ - (XMPPJID*)JID { - OF_GETTER(_JID, YES); + OF_GETTER(_JID, true) } - (OFString*)node { - OF_GETTER(_node, YES); + OF_GETTER(_node, true) } - (OFString*)name { - OF_GETTER(_name, YES); + OF_GETTER(_name, true) } - (OFSortedList*)identities { - OF_GETTER(_identities, YES); + OF_GETTER(_identities, true) } - (OFSortedList*)features { - OF_GETTER(_features, YES); + OF_GETTER(_features, true) } - (OFDictionary*)childNodes { - OF_GETTER(_childNodes, YES); + OF_GETTER(_childNodes, true) } - (void)addIdentity: (XMPPDiscoIdentity*)identity @@ -138,7 +138,7 @@ forKey: [node node]]; } -- (BOOL)XMPP_handleItemsIQ: (XMPPIQ*)IQ +- (bool)XMPP_handleItemsIQ: (XMPPIQ*)IQ connection: (XMPPConnection*)connection { XMPPIQ *resultIQ; @@ -150,7 +150,7 @@ OFString *node = [[query attributeForName: @"node"] stringValue]; if (!(node == _node) && ![node isEqual: _node]) - return NO; + return false; resultIQ = [IQ resultIQ]; response = [OFXMLElement elementWithName: @"query" @@ -177,10 +177,10 @@ [connection sendStanza: resultIQ]; - return YES; + return true; } -- (BOOL)XMPP_handleInfoIQ: (XMPPIQ*)IQ +- (bool)XMPP_handleInfoIQ: (XMPPIQ*)IQ connection: (XMPPConnection*)connection { XMPPIQ *resultIQ; @@ -223,6 +223,6 @@ [connection sendStanza: resultIQ]; - return YES; + return true; } @end diff --git a/src/XMPPFileStorage.m b/src/XMPPFileStorage.m index 3f9529a..0634239 100644 --- a/src/XMPPFileStorage.m +++ b/src/XMPPFileStorage.m @@ -154,7 +154,7 @@ return string; } -- (void)setBooleanValue: (BOOL)boolean +- (void)setBooleanValue: (bool)boolean forPath: (OFString*)path { OFAutoreleasePool *pool = [OFAutoreleasePool new]; @@ -165,10 +165,10 @@ [pool release]; } -- (BOOL)booleanValueForPath: (OFString*)path +- (bool)booleanValueForPath: (OFString*)path { OFAutoreleasePool *pool = [OFAutoreleasePool new]; - BOOL boolean; + bool boolean; boolean = [[self XMPP_objectForPath: path] boolValue]; diff --git a/src/XMPPJID.m b/src/XMPPJID.m index dfafdd1..78a7916 100644 --- a/src/XMPPJID.m +++ b/src/XMPPJID.m @@ -231,24 +231,23 @@ XMPPJID *JID; if (object == self) - return YES; + return true; if (![object isKindOfClass: [XMPPJID class]]) - return NO; + return false; JID = object; // Node and resource may be nil if ((_node == JID->_node || [_node isEqual: JID->_node]) && - [_domain isEqual: JID->_domain] && - (_resource == JID->_resource || [_resource isEqual: JID->_resource]) - ) - return YES; + [_domain isEqual: JID->_domain] && (_resource == JID->_resource || + [_resource isEqual: JID->_resource])) + return true; - return NO; + return false; } -- (uint32_t) hash +- (uint32_t)hash { uint32_t hash; diff --git a/src/XMPPMulticastDelegate.h b/src/XMPPMulticastDelegate.h index c7dbbc8..8b2b84e 100644 --- a/src/XMPPMulticastDelegate.h +++ b/src/XMPPMulticastDelegate.h @@ -52,7 +52,7 @@ * \param selector The selector to broadcast * \param object The object to broadcast */ -- (BOOL)broadcastSelector: (SEL)selector +- (bool)broadcastSelector: (SEL)selector withObject: (id)object; /** @@ -62,7 +62,7 @@ * \param object1 The first object to broadcast * \param object2 The second object to broadcast */ -- (BOOL)broadcastSelector: (SEL)selector +- (bool)broadcastSelector: (SEL)selector withObject: (id)object1 withObject: (id)object2; @end diff --git a/src/XMPPMulticastDelegate.m b/src/XMPPMulticastDelegate.m index fb2ede6..df3a704 100644 --- a/src/XMPPMulticastDelegate.m +++ b/src/XMPPMulticastDelegate.m @@ -70,13 +70,13 @@ } } -- (BOOL)broadcastSelector: (SEL)selector +- (bool)broadcastSelector: (SEL)selector withObject: (id)object { OFDataArray *currentDelegates = [_delegates copy]; id *items = [currentDelegates items]; size_t i, count = [currentDelegates count]; - BOOL handled = NO; + bool handled = false; for (i = 0; i < count; i++) { id responder = items[i]; @@ -84,7 +84,7 @@ if (![responder respondsToSelector: selector]) continue; - BOOL (*imp)(id, SEL, id) = (BOOL(*)(id, SEL, id)) + bool (*imp)(id, SEL, id) = (bool(*)(id, SEL, id)) [responder methodForSelector: selector]; handled |= imp(responder, selector, object); @@ -93,14 +93,14 @@ return handled; } -- (BOOL)broadcastSelector: (SEL)selector +- (bool)broadcastSelector: (SEL)selector withObject: (id)object1 withObject: (id)object2 { OFDataArray *currentDelegates = [_delegates copy]; id *items = [currentDelegates items]; size_t i, count = [currentDelegates count]; - BOOL handled = NO; + bool handled = false; for (i = 0; i < count; i++) { id responder = items[i]; @@ -108,7 +108,7 @@ if (![responder respondsToSelector: selector]) continue; - BOOL (*imp)(id, SEL, id, id) = (BOOL(*)(id, SEL, id, id)) + bool (*imp)(id, SEL, id, id) = (bool(*)(id, SEL, id, id)) [responder methodForSelector: selector]; handled |= imp(responder, selector, object1, object2); diff --git a/src/XMPPPresence.m b/src/XMPPPresence.m index 21d1e62..a5e7308 100644 --- a/src/XMPPPresence.m +++ b/src/XMPPPresence.m @@ -150,7 +150,7 @@ static int show_to_int(OFString *show) namespace: XMPP_NS_CLIENT stringValue: show]]; - OF_SETTER(_show, show, YES, 1); + OF_SETTER(_show, show, true, 1) } - (OFString*)show @@ -171,7 +171,7 @@ static int show_to_int(OFString *show) namespace: XMPP_NS_CLIENT stringValue: status]]; - OF_SETTER(_status, status, YES, 1); + OF_SETTER(_status, status, true, 1) } - (OFString*)status @@ -198,7 +198,7 @@ static int show_to_int(OFString *show) namespace: XMPP_NS_CLIENT stringValue: priority_s]]; - OF_SETTER(_priority, priority, YES, 1); + OF_SETTER(_priority, priority, true, 1) } - (OFNumber*)priority diff --git a/src/XMPPRoster.h b/src/XMPPRoster.h index fd16c33..2e6694f 100644 --- a/src/XMPPRoster.h +++ b/src/XMPPRoster.h @@ -72,7 +72,7 @@ OFMutableDictionary *_rosterItems; XMPPMulticastDelegate *_delegates; id _dataStorage; - BOOL _rosterRequested; + bool _rosterRequested; } #ifdef OF_HAVE_PROPERTIES diff --git a/src/XMPPRoster.m b/src/XMPPRoster.m index 901612e..c5f84a6 100644 --- a/src/XMPPRoster.m +++ b/src/XMPPRoster.m @@ -77,7 +77,7 @@ XMPPIQ *iq; OFXMLElement *query; - _rosterRequested = YES; + _rosterRequested = true; iq = [XMPPIQ IQWithType: @"get" ID: [_connection generateStanzaID]]; @@ -86,7 +86,8 @@ namespace: XMPP_NS_ROSTER]; if ([_connection supportsRosterVersioning]) { - OFString *ver = [_dataStorage stringValueForPath: @"roster.ver"]; + OFString *ver = + [_dataStorage stringValueForPath: @"roster.ver"]; if (ver == nil) ver = @""; @@ -103,7 +104,7 @@ IQ:)]; } -- (BOOL)connection: (XMPPConnection*)connection +- (bool)connection: (XMPPConnection*)connection didReceiveIQ: (XMPPIQ*)iq { OFXMLElement *rosterElement; @@ -114,10 +115,10 @@ namespace: XMPP_NS_ROSTER]; if (rosterElement == nil) - return NO; + return false; if (![[iq type] isEqual: @"set"]) - return NO; + return false; element = [rosterElement elementForName: @"item" namespace: XMPP_NS_ROSTER]; @@ -143,7 +144,7 @@ [connection sendStanza: [iq resultIQ]]; - return YES; + return true; } - (void)addRosterItem: (XMPPRosterItem*)rosterItem diff --git a/src/XMPPRosterItem.m b/src/XMPPRosterItem.m index 3a9024b..f314489 100644 --- a/src/XMPPRosterItem.m +++ b/src/XMPPRosterItem.m @@ -71,41 +71,41 @@ - (void)setJID: (XMPPJID*)JID { - OF_SETTER(_JID, JID, YES, YES) + OF_SETTER(_JID, JID, true, 1) } - (XMPPJID*)JID { - OF_GETTER(_JID, YES) + OF_GETTER(_JID, true) } - (void)setName: (OFString*)name { - OF_SETTER(_name, name, YES, YES) + OF_SETTER(_name, name, true, 1) } - (OFString*)name { - OF_GETTER(_name, YES) + OF_GETTER(_name, true) } - (void)setSubscription: (OFString*)subscription { - OF_SETTER(_subscription, subscription, YES, YES) + OF_SETTER(_subscription, subscription, true, 1) } - (OFString*)subscription { - OF_GETTER(_subscription, YES) + OF_GETTER(_subscription, true) } - (void)setGroups: (OFArray*)groups { - OF_SETTER(_groups, groups, YES, YES) + OF_SETTER(_groups, groups, true, 1) } - (OFArray*)groups { - OF_GETTER(_groups, YES) + OF_GETTER(_groups, true) } @end diff --git a/src/XMPPSCRAMAuth.h b/src/XMPPSCRAMAuth.h index bc1df64..f612d96 100644 --- a/src/XMPPSCRAMAuth.h +++ b/src/XMPPSCRAMAuth.h @@ -35,8 +35,8 @@ OFString *_clientFirstMessageBare; OFDataArray *_serverSignature; XMPPConnection *_connection; - BOOL _plusAvailable; - BOOL _authenticated; + bool _plusAvailable; + bool _authenticated; } /** @@ -53,7 +53,7 @@ password: (OFString*)password connection: (XMPPConnection*)connection hash: (Class)hash - plusAvailable: (BOOL)plusAvailable; + plusAvailable: (bool)plusAvailable; /** * \brief Creates a new autoreleased XMPPSCRAMAuth with an authzid, authcid and @@ -72,7 +72,7 @@ password: (OFString*)password connection: (XMPPConnection*)connection hash: (Class)hash - plusAvailable: (BOOL)plusAvailable; + plusAvailable: (bool)plusAvailable; /** * \brief Initializes an already allocated XMPPSCRAMAuth with an authcid and @@ -89,7 +89,7 @@ password: (OFString*)password connection: (XMPPConnection*)connection hash: (Class)hash - plusAvailable: (BOOL)plusAvailable; + plusAvailable: (bool)plusAvailable; /** * \brief Initializes an already allocated XMPPSCRAMAuth with a authzid, @@ -108,7 +108,7 @@ password: (OFString*)password connection: (XMPPConnection*)connection hash: (Class)hash - plusAvailable: (BOOL)plusAvailable; + plusAvailable: (bool)plusAvailable; /// \cond internal - (OFString*)XMPP_genNonce; diff --git a/src/XMPPSCRAMAuth.m b/src/XMPPSCRAMAuth.m index 7e807af..dc27661 100644 --- a/src/XMPPSCRAMAuth.m +++ b/src/XMPPSCRAMAuth.m @@ -42,7 +42,7 @@ password: (OFString*)password connection: (XMPPConnection*)connection hash: (Class)hash - plusAvailable: (BOOL)plusAvailable + plusAvailable: (bool)plusAvailable { return [[[self alloc] initWithAuthcid: authcid password: password @@ -56,7 +56,7 @@ password: (OFString*)password connection: (XMPPConnection*)connection hash: (Class)hash - plusAvailable: (BOOL)plusAvailable + plusAvailable: (bool)plusAvailable { return [[[self alloc] initWithAuthzid: authzid authcid: authcid @@ -70,7 +70,7 @@ password: (OFString*)password connection: (XMPPConnection*)connection hash: (Class)hash - plusAvailable: (BOOL)plusAvailable + plusAvailable: (bool)plusAvailable { return [self initWithAuthzid: nil authcid: authcid @@ -85,7 +85,7 @@ password: (OFString*)password connection: (XMPPConnection*)connection hash: (Class)hash - plusAvailable: (BOOL)plusAvailable + plusAvailable: (bool)plusAvailable { self = [super initWithAuthzid: authzid authcid: authcid @@ -154,7 +154,7 @@ _GS2Header = nil; [_serverSignature release]; _serverSignature = nil; - _authenticated = NO; + _authenticated = false; if (_authzid) _GS2Header = [[OFString alloc] @@ -390,7 +390,7 @@ exceptionWithConnection: nil reason: @"Received wrong " @"ServerSignature"]; - _authenticated = YES; + _authenticated = true; } else @throw [XMPPAuthFailedException exceptionWithConnection: nil reason: value]; diff --git a/src/XMPPSRVLookup.h b/src/XMPPSRVLookup.h index 924c325..a11f342 100644 --- a/src/XMPPSRVLookup.h +++ b/src/XMPPSRVLookup.h @@ -86,7 +86,7 @@ OFList *list; of_list_object_t *listIter; OFList *subListCopy; - BOOL done; + bool done; } - initWithList: (OFList*)list; diff --git a/src/XMPPSRVLookup.m b/src/XMPPSRVLookup.m index f35a261..c5df961 100644 --- a/src/XMPPSRVLookup.m +++ b/src/XMPPSRVLookup.m @@ -158,7 +158,7 @@ - (OFString*)target { - OF_GETTER(_target, YES) + OF_GETTER(_target, true) } @end @@ -195,7 +195,7 @@ - (OFString*)domain; { - OF_GETTER(_domain, YES) + OF_GETTER(_domain, true) } - (void)XMPP_lookup @@ -366,7 +366,7 @@ listIter = listIter->next; if (listIter == NULL) - done = YES; + done = true; } return ret; @@ -377,6 +377,6 @@ listIter = NULL; [subListCopy release]; subListCopy = nil; - done = NO; + done = false; } @end diff --git a/src/XMPPStorage.h b/src/XMPPStorage.h index 0011a9a..3c9f486 100644 --- a/src/XMPPStorage.h +++ b/src/XMPPStorage.h @@ -20,7 +20,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include +#import @class OFString; @class OFArray; @@ -31,9 +31,9 @@ - (void)setStringValue: (OFString*)string forPath: (OFString*)path; - (OFString*)stringValueForPath: (OFString*)path; -- (void)setBooleanValue: (BOOL)boolean +- (void)setBooleanValue: (bool)boolean forPath: (OFString*)path; -- (BOOL)booleanValueForPath: (OFString*)path; +- (bool)booleanValueForPath: (OFString*)path; - (void)setIntegerValue: (intmax_t)integer forPath: (OFString*)path; - (intmax_t)integerValueForPath: (OFString*)path; diff --git a/tests/test.m b/tests/test.m index 70f5899..a1f7514 100644 --- a/tests/test.m +++ b/tests/test.m @@ -153,7 +153,7 @@ OF_APPLICATION_DELEGATE(AppDelegate) { of_log(@"Bound to JID: %@", [jid fullJID]); of_log(@"Supports SM: %@", - [conn_ supportsStreamManagement] ? @"YES" : @"NO"); + [conn_ supportsStreamManagement] ? @"true" : @"false"); XMPPDiscoEntity *discoEntity = [[XMPPDiscoEntity alloc] initWithConnection: conn]; @@ -244,7 +244,7 @@ OF_APPLICATION_DELEGATE(AppDelegate) of_log(@"Got roster push: %@", rosterItem); } -- (BOOL)connection: (XMPPConnection*)conn +- (bool)connection: (XMPPConnection*)conn didReceiveIQ: (XMPPIQ*)iq { of_log(@"IQ: %@", iq);