Index: src/XMPPAuthenticator.m ================================================================== --- src/XMPPAuthenticator.m +++ src/XMPPAuthenticator.m @@ -62,36 +62,36 @@ [super dealloc]; } - (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 { return nil; Index: src/XMPPConnection.h ================================================================== --- src/XMPPConnection.h +++ src/XMPPConnection.h @@ -85,11 +85,11 @@ * \brief This callback is called when the connection received an IQ stanza. * * \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; /** * \brief This callback is called when the connection received a presence * stanza. @@ -164,15 +164,15 @@ id _dataStorage; OFString *_language; 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; } #ifdef OF_HAVE_PROPERTIES /// \brief The username to use for authentication @@ -202,17 +202,17 @@ /// \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) 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 /** * \brief Creates a new autoreleased XMPPConnection. * @@ -251,11 +251,11 @@ * \param reason A pointer to an OFString which is set to a reason in case the * certificate is not valid (otherwise, it does not touch it). * 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. */ - (void)handleConnection; @@ -288,25 +288,25 @@ /** * \brief Returns whether encryption is encrypted. * * \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. * * \param element The element to send @@ -358,12 +358,12 @@ - (uint16_t)port; - (void)setDataStorage: (id )dataStorage; - (id )dataStorage; - (void)setLanguage: (OFString*)language; - (OFString*)language; -- (BOOL)supportsRosterVersioning; -- (BOOL)supportsStreamManagement; +- (bool)supportsRosterVersioning; +- (bool)supportsStreamManagement; - (void)XMPP_startStream; - (void)XMPP_handleStream: (OFXMLElement*)element; - (void)XMPP_handleTLS: (OFXMLElement*)element; - (void)XMPP_handleSASL: (OFXMLElement*)element; Index: src/XMPPConnection.m ================================================================== --- src/XMPPConnection.m +++ src/XMPPConnection.m @@ -106,11 +106,11 @@ [connection connect]; [self performSelector: @selector(didConnect) onThread: sourceThread - waitUntilDone: NO]; + waitUntilDone: false]; [pool release]; return nil; } @@ -126,12 +126,10 @@ { self = [super init]; @try { _port = 5222; - _encrypted = NO; - _streamOpen = NO; _delegates = [[XMPPMulticastDelegate alloc] init]; _callbacks = [[OFMutableDictionary alloc] init]; } @catch (id e) { [self release]; @throw e; @@ -307,26 +305,26 @@ return [[_password copy] autorelease]; } - (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 { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; @@ -395,30 +393,30 @@ connection: self] autorelease] start]; [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 { [_parser parseBuffer: buffer length: length]; } @catch (OFMalformedXMLException *e) { [self XMPP_sendStreamError: @"bad-format" text: nil]; [self close]; - return NO; + return false; } - return YES; + return true; } - (void)parseBuffer: (const void*)buffer length: (size_t)length { @@ -430,11 +428,11 @@ _oldParser = nil; _oldElementBuilder = nil; } -- (BOOL)stream: (OFStream*)stream +- (bool)stream: (OFStream*)stream didReadIntoBuffer: (char*)buffer length: (size_t)length exception: (OFException*)exception { if (exception != nil) { @@ -441,24 +439,24 @@ [_delegates broadcastSelector: @selector(connection: didThrowException:) 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) { [_oldParser release]; [_oldElementBuilder release]; @@ -471,85 +469,85 @@ target: self selector: @selector(stream: didReadIntoBuffer:length: exception:)]; - return NO; + return false; } - return YES; + return true; } - (OFTCPSocket*)socket { 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]; } @catch (SSLInvalidCertificateException *e) { if (reason != NULL) *reason = [[[e reason] copy] autorelease]; - return NO; + return false; } cert = [_socket peerCertificate]; SANs = [cert subjectAlternativeName]; if ([[SANs objectForKey: @"otherName"] 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 { [_delegates broadcastSelector: @selector(connection:didSendElement:) @@ -721,11 +719,11 @@ @"", _domain, langString]; - _streamOpen = YES; + _streamOpen = true; } - (void)close { if (_streamOpen) @@ -740,12 +738,12 @@ _authModule = nil; [_socket release]; _socket = nil; [_JID release]; _JID = nil; - _streamOpen = _needsSession = _encrypted = NO; - _supportsRosterVersioning = _supportsStreamManagement = NO; + _streamOpen = _needsSession = _encrypted = false; + _supportsRosterVersioning = _supportsStreamManagement = false; _lastID = 0; } - (void)XMPP_handleStanza: (OFXMLElement*)element { @@ -891,11 +889,11 @@ [newSock setPrivateKeyPassphrase: _privateKeyPassphrase]; [newSock startTLS]; [_socket release]; _socket = newSock; - _encrypted = YES; + _encrypted = true; [_delegates broadcastSelector: @selector( connectionDidUpgradeToTLS:) withObject: self]; @@ -960,11 +958,11 @@ assert(0); } - (void)XMPP_handleIQ: (XMPPIQ*)iq { - BOOL handled = NO; + bool handled = false; XMPPCallback *callback; if ((callback = [_callbacks objectForKey: [iq ID]])) { [callback runWithIQ: iq connection: self]; @@ -1021,15 +1019,15 @@ /* TODO: Find/create an exception to throw here */ @throw [OFException exception]; 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; OFXMLElement *mech; @@ -1048,11 +1046,11 @@ _authModule = [[XMPPSCRAMAuth alloc] initWithAuthcid: _username password: _password connection: self hash: [OFSHA1Hash class] - plusAvailable: YES]; + plusAvailable: true]; [self XMPP_sendAuth: @"SCRAM-SHA-1-PLUS"]; return; } if ([mechanisms containsObject: @"SCRAM-SHA-1"]) { @@ -1059,11 +1057,11 @@ _authModule = [[XMPPSCRAMAuth alloc] initWithAuthcid: _username password: _password connection: self hash: [OFSHA1Hash class] - plusAvailable: NO]; + plusAvailable: false]; [self XMPP_sendAuth: @"SCRAM-SHA-1"]; return; } if ([mechanisms containsObject: @"PLAIN"] && _encrypted) { @@ -1076,11 +1074,11 @@ assert(0); } if (session != nil) - _needsSession = YES; + _needsSession = true; if (bind != nil) { [self XMPP_sendResourceBind]; return; } @@ -1254,16 +1252,16 @@ return _dataStorage; } - (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 { [_delegates addDelegate: delegate]; Index: src/XMPPContact.m ================================================================== --- src/XMPPContact.m +++ src/XMPPContact.m @@ -46,16 +46,16 @@ [super dealloc]; } - (XMPPRosterItem*)rosterItem { - OF_GETTER(_rosterItem, YES); + OF_GETTER(_rosterItem, true) } - (OFDictionary*)presences { - OF_GETTER(_presences, YES); + OF_GETTER(_presences, true) } - (void)sendMessage: (XMPPMessage*)message connection: (XMPPConnection*)connection { @@ -67,11 +67,11 @@ [connection sendStanza: message]; } - (void)XMPP_setRosterItem: (XMPPRosterItem*)rosterItem { - OF_SETTER(_rosterItem, rosterItem, YES, 0); + OF_SETTER(_rosterItem, rosterItem, true, 0); } - (void)XMPP_setPresence: (XMPPPresence*)presence resource: (OFString*)resource { @@ -80,11 +80,11 @@ forKey: resource]; else [_presences setObject: presence forKey: @""]; - OF_SETTER(_lockedOnJID, nil, YES, 0); + [self XMPP_setLockedOnJID: nil]; } - (void)XMPP_removePresenceForResource: (OFString*)resource { if (resource != nil) { @@ -92,13 +92,13 @@ } else { [_presences release]; _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 Index: src/XMPPContactManager.m ================================================================== --- src/XMPPContactManager.m +++ src/XMPPContactManager.m @@ -84,11 +84,11 @@ [_delegates removeDelegate: delegate]; } - (OFDictionary*)contacts { - OF_GETTER(_contacts, YES); + OF_GETTER(_contacts, true) } - (void)rosterWasReceived: (XMPPRoster*)roster_ { OFEnumerator *contactEnumerator; Index: src/XMPPDiscoEntity.m ================================================================== --- src/XMPPDiscoEntity.m +++ src/XMPPDiscoEntity.m @@ -72,11 +72,11 @@ [super dealloc]; } - (OFDictionary*)discoNodes; { - OF_GETTER(_discoNodes, YES); + OF_GETTER(_discoNodes, true) } - (void)addDiscoNode: (XMPPDiscoNode*)node { [_discoNodes setObject: node @@ -83,11 +83,11 @@ forKey: [node node]]; } - (OFString*)capsNode { - OF_GETTER(_capsNode, YES); + OF_GETTER(_capsNode, true) } - (OFString*)capsHash { OFEnumerator *enumerator; @@ -119,15 +119,15 @@ wasBoundToJID: (XMPPJID*)JID { _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]; if (query != nil) { @@ -140,11 +140,11 @@ XMPPDiscoNode *responder = [_discoNodes objectForKey: node]; if (responder != nil) return [responder XMPP_handleItemsIQ: IQ connection: connection]; - return NO; + return false; } query = [IQ elementForName: @"query" namespace: XMPP_NS_DISCO_INFO]; @@ -165,11 +165,11 @@ XMPPDiscoNode *responder = [_discoNodes objectForKey: node]; if (responder != nil) return [responder XMPP_handleInfoIQ: IQ connection: connection]; - return NO; + return false; } - return NO; + return false; } @end Index: src/XMPPDiscoIdentity.m ================================================================== --- src/XMPPDiscoIdentity.m +++ src/XMPPDiscoIdentity.m @@ -89,44 +89,44 @@ [super dealloc]; } - (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 { 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; OF_HASH_INIT(hash); Index: src/XMPPDiscoNode.h ================================================================== --- src/XMPPDiscoNode.h +++ src/XMPPDiscoNode.h @@ -126,10 +126,10 @@ - (OFString*)node; - (OFSortedList*)identities; - (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 Index: src/XMPPDiscoNode.m ================================================================== --- src/XMPPDiscoNode.m +++ src/XMPPDiscoNode.m @@ -92,36 +92,36 @@ [super dealloc]; } - (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 { [_identities insertObject: identity]; @@ -136,11 +136,11 @@ { [_childNodes setObject: node forKey: [node node]]; } -- (BOOL)XMPP_handleItemsIQ: (XMPPIQ*)IQ +- (bool)XMPP_handleItemsIQ: (XMPPIQ*)IQ connection: (XMPPConnection*)connection { XMPPIQ *resultIQ; OFXMLElement *response; XMPPDiscoNode *child; @@ -148,11 +148,11 @@ OFXMLElement *query = [IQ elementForName: @"query" namespace: XMPP_NS_DISCO_ITEMS]; OFString *node = [[query attributeForName: @"node"] stringValue]; if (!(node == _node) && ![node isEqual: _node]) - return NO; + return false; resultIQ = [IQ resultIQ]; response = [OFXMLElement elementWithName: @"query" namespace: XMPP_NS_DISCO_ITEMS]; [resultIQ addChild: response]; @@ -175,14 +175,14 @@ [response addChild: item]; } [connection sendStanza: resultIQ]; - return YES; + return true; } -- (BOOL)XMPP_handleInfoIQ: (XMPPIQ*)IQ +- (bool)XMPP_handleInfoIQ: (XMPPIQ*)IQ connection: (XMPPConnection*)connection { XMPPIQ *resultIQ; OFXMLElement *response; OFEnumerator *enumerator; @@ -221,8 +221,8 @@ [response addChild: featureElement]; } [connection sendStanza: resultIQ]; - return YES; + return true; } @end Index: src/XMPPFileStorage.m ================================================================== --- src/XMPPFileStorage.m +++ src/XMPPFileStorage.m @@ -152,11 +152,11 @@ [pool release]; return string; } -- (void)setBooleanValue: (BOOL)boolean +- (void)setBooleanValue: (bool)boolean forPath: (OFString*)path { OFAutoreleasePool *pool = [OFAutoreleasePool new]; [self XMPP_setObject: [OFNumber numberWithBool: boolean] @@ -163,14 +163,14 @@ forPath: path]; [pool release]; } -- (BOOL)booleanValueForPath: (OFString*)path +- (bool)booleanValueForPath: (OFString*)path { OFAutoreleasePool *pool = [OFAutoreleasePool new]; - BOOL boolean; + bool boolean; boolean = [[self XMPP_objectForPath: path] boolValue]; [pool release]; Index: src/XMPPJID.m ================================================================== --- src/XMPPJID.m +++ src/XMPPJID.m @@ -229,28 +229,27 @@ - (bool)isEqual: (id)object { 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; OF_HASH_INIT(hash); Index: src/XMPPMulticastDelegate.h ================================================================== --- src/XMPPMulticastDelegate.h +++ src/XMPPMulticastDelegate.h @@ -50,19 +50,19 @@ * \brief Broadcasts a selector with an object to all registered delegates. * * \param selector The selector to broadcast * \param object The object to broadcast */ -- (BOOL)broadcastSelector: (SEL)selector +- (bool)broadcastSelector: (SEL)selector withObject: (id)object; /** * \brief Broadcasts a selector with two objects to all registered delegates. * * \param selector The selector to broadcast * \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 Index: src/XMPPMulticastDelegate.m ================================================================== --- src/XMPPMulticastDelegate.m +++ src/XMPPMulticastDelegate.m @@ -68,52 +68,52 @@ [_delegates removeItemAtIndex: i]; return; } } -- (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]; 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); } 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]; 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); } return handled; } @end Index: src/XMPPPresence.m ================================================================== --- src/XMPPPresence.m +++ src/XMPPPresence.m @@ -148,11 +148,11 @@ if (show != nil) [self addChild: [OFXMLElement elementWithName: @"show" namespace: XMPP_NS_CLIENT stringValue: show]]; - OF_SETTER(_show, show, YES, 1); + OF_SETTER(_show, show, true, 1) } - (OFString*)show { return [[_show copy] autorelease]; @@ -169,11 +169,11 @@ if (status != nil) [self addChild: [OFXMLElement elementWithName: @"status" namespace: XMPP_NS_CLIENT stringValue: status]]; - OF_SETTER(_status, status, YES, 1); + OF_SETTER(_status, status, true, 1) } - (OFString*)status { return [[_status copy] autorelease]; @@ -196,11 +196,11 @@ [OFString stringWithFormat: @"%" @PRId8, [priority int8Value]]; [self addChild: [OFXMLElement elementWithName: @"priority" namespace: XMPP_NS_CLIENT stringValue: priority_s]]; - OF_SETTER(_priority, priority, YES, 1); + OF_SETTER(_priority, priority, true, 1) } - (OFNumber*)priority { return [[_priority copy] autorelease]; Index: src/XMPPRoster.h ================================================================== --- src/XMPPRoster.h +++ src/XMPPRoster.h @@ -70,11 +70,11 @@ { XMPPConnection *_connection; OFMutableDictionary *_rosterItems; XMPPMulticastDelegate *_delegates; id _dataStorage; - BOOL _rosterRequested; + bool _rosterRequested; } #ifdef OF_HAVE_PROPERTIES /** * \brief The connection to which the roster belongs Index: src/XMPPRoster.m ================================================================== --- src/XMPPRoster.m +++ src/XMPPRoster.m @@ -75,20 +75,21 @@ - (void)requestRoster { XMPPIQ *iq; OFXMLElement *query; - _rosterRequested = YES; + _rosterRequested = true; iq = [XMPPIQ IQWithType: @"get" ID: [_connection generateStanzaID]]; query = [OFXMLElement elementWithName: @"query" namespace: XMPP_NS_ROSTER]; if ([_connection supportsRosterVersioning]) { - OFString *ver = [_dataStorage stringValueForPath: @"roster.ver"]; + OFString *ver = + [_dataStorage stringValueForPath: @"roster.ver"]; if (ver == nil) ver = @""; [query addAttributeWithName: @"ver" @@ -101,11 +102,11 @@ callbackTarget: self selector: @selector(XMPP_handleInitialRosterForConnection: IQ:)]; } -- (BOOL)connection: (XMPPConnection*)connection +- (bool)connection: (XMPPConnection*)connection didReceiveIQ: (XMPPIQ*)iq { OFXMLElement *rosterElement; OFXMLElement *element; XMPPRosterItem *rosterItem; @@ -112,14 +113,14 @@ rosterElement = [iq elementForName: @"query" 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]; if (element != nil) { @@ -141,11 +142,11 @@ [_dataStorage save]; } [connection sendStanza: [iq resultIQ]]; - return YES; + return true; } - (void)addRosterItem: (XMPPRosterItem*)rosterItem { [self updateRosterItem: rosterItem]; Index: src/XMPPRosterItem.m ================================================================== --- src/XMPPRosterItem.m +++ src/XMPPRosterItem.m @@ -69,43 +69,43 @@ _JID, _name, _subscription, _groups]; } - (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 Index: src/XMPPSCRAMAuth.h ================================================================== --- src/XMPPSCRAMAuth.h +++ src/XMPPSCRAMAuth.h @@ -33,12 +33,12 @@ OFString *_cNonce; OFString *_GS2Header; OFString *_clientFirstMessageBare; OFDataArray *_serverSignature; XMPPConnection *_connection; - BOOL _plusAvailable; - BOOL _authenticated; + bool _plusAvailable; + bool _authenticated; } /** * \brief Creates a new autoreleased XMPPSCRAMAuth with an authcid and password. * @@ -51,11 +51,11 @@ */ + SCRAMAuthWithAuthcid: (OFString*)authcid 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 * password. * @@ -70,11 +70,11 @@ + SCRAMAuthWithAuthzid: (OFString*)authzid authcid: (OFString*)authcid 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 * password. * @@ -87,11 +87,11 @@ */ - initWithAuthcid: (OFString*)authcid password: (OFString*)password connection: (XMPPConnection*)connection hash: (Class)hash - plusAvailable: (BOOL)plusAvailable; + plusAvailable: (bool)plusAvailable; /** * \brief Initializes an already allocated XMPPSCRAMAuth with a authzid, * authcid and password. * @@ -106,11 +106,11 @@ - initWithAuthzid: (OFString*)authzid authcid: (OFString*)authcid password: (OFString*)password connection: (XMPPConnection*)connection hash: (Class)hash - plusAvailable: (BOOL)plusAvailable; + plusAvailable: (bool)plusAvailable; /// \cond internal - (OFString*)XMPP_genNonce; - (uint8_t*)XMPP_HMACWithKey: (OFDataArray*)key data: (OFDataArray*)data; Index: src/XMPPSCRAMAuth.m ================================================================== --- src/XMPPSCRAMAuth.m +++ src/XMPPSCRAMAuth.m @@ -40,11 +40,11 @@ @implementation XMPPSCRAMAuth + SCRAMAuthWithAuthcid: (OFString*)authcid password: (OFString*)password connection: (XMPPConnection*)connection hash: (Class)hash - plusAvailable: (BOOL)plusAvailable + plusAvailable: (bool)plusAvailable { return [[[self alloc] initWithAuthcid: authcid password: password connection: connection hash: hash @@ -54,11 +54,11 @@ + SCRAMAuthWithAuthzid: (OFString*)authzid authcid: (OFString*)authcid password: (OFString*)password connection: (XMPPConnection*)connection hash: (Class)hash - plusAvailable: (BOOL)plusAvailable + plusAvailable: (bool)plusAvailable { return [[[self alloc] initWithAuthzid: authzid authcid: authcid password: password connection: connection @@ -68,11 +68,11 @@ - initWithAuthcid: (OFString*)authcid password: (OFString*)password connection: (XMPPConnection*)connection hash: (Class)hash - plusAvailable: (BOOL)plusAvailable + plusAvailable: (bool)plusAvailable { return [self initWithAuthzid: nil authcid: authcid password: password connection: connection @@ -83,11 +83,11 @@ - initWithAuthzid: (OFString*)authzid authcid: (OFString*)authcid password: (OFString*)password connection: (XMPPConnection*)connection hash: (Class)hash - plusAvailable: (BOOL)plusAvailable + plusAvailable: (bool)plusAvailable { self = [super initWithAuthzid: authzid authcid: authcid password: password]; @@ -152,11 +152,11 @@ _cNonce = nil; [_GS2Header release]; _GS2Header = nil; [_serverSignature release]; _serverSignature = nil; - _authenticated = NO; + _authenticated = false; if (_authzid) _GS2Header = [[OFString alloc] initWithFormat: @"%@,a=%@,", (_plusAvailable ? @"p=tls-unique" : @"y"), @@ -388,11 +388,11 @@ if (![value isEqual: [_serverSignature stringByBase64Encoding]]) @throw [XMPPAuthFailedException exceptionWithConnection: nil reason: @"Received wrong " @"ServerSignature"]; - _authenticated = YES; + _authenticated = true; } else @throw [XMPPAuthFailedException exceptionWithConnection: nil reason: value]; return nil; Index: src/XMPPSRVLookup.h ================================================================== --- src/XMPPSRVLookup.h +++ src/XMPPSRVLookup.h @@ -84,10 +84,10 @@ @interface XMPPSRVEnumerator: OFEnumerator { OFList *list; of_list_object_t *listIter; OFList *subListCopy; - BOOL done; + bool done; } - initWithList: (OFList*)list; @end Index: src/XMPPSRVLookup.m ================================================================== --- src/XMPPSRVLookup.m +++ src/XMPPSRVLookup.m @@ -156,11 +156,11 @@ return _port; } - (OFString*)target { - OF_GETTER(_target, YES) + OF_GETTER(_target, true) } @end @implementation XMPPSRVLookup + lookupWithDomain: (OFString*)domain @@ -193,11 +193,11 @@ [super dealloc]; } - (OFString*)domain; { - OF_GETTER(_domain, YES) + OF_GETTER(_domain, true) } - (void)XMPP_lookup { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; @@ -364,11 +364,11 @@ subListCopy = nil; listIter = listIter->next; if (listIter == NULL) - done = YES; + done = true; } return ret; } @@ -375,8 +375,8 @@ - (void)reset { listIter = NULL; [subListCopy release]; subListCopy = nil; - done = NO; + done = false; } @end Index: src/XMPPStorage.h ================================================================== --- src/XMPPStorage.h +++ src/XMPPStorage.h @@ -18,11 +18,11 @@ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#include +#import @class OFString; @class OFArray; @class OFDictionary; @@ -29,13 +29,13 @@ @protocol XMPPStorage - (void)save; - (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; - (void)setArray: (OFArray*)array forPath: (OFString*)path; Index: tests/test.m ================================================================== --- tests/test.m +++ tests/test.m @@ -151,11 +151,11 @@ - (void)connection: (XMPPConnection*)conn_ wasBoundToJID: (XMPPJID*)jid { 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]; [discoEntity addIdentity: @@ -242,11 +242,11 @@ didReceiveRosterItem: (XMPPRosterItem*)rosterItem { of_log(@"Got roster push: %@", rosterItem); } -- (BOOL)connection: (XMPPConnection*)conn +- (bool)connection: (XMPPConnection*)conn didReceiveIQ: (XMPPIQ*)iq { of_log(@"IQ: %@", iq); return NO;