Get rid of BOOL.

This commit is contained in:
Jonathan Schleifer 2013-06-23 21:54:12 +02:00
parent 7f5c58ffc7
commit cd292b53fa
23 changed files with 156 additions and 158 deletions

View file

@ -64,32 +64,32 @@
- (void)setAuthzid: (OFString*)authzid - (void)setAuthzid: (OFString*)authzid
{ {
OF_SETTER(_authzid, authzid, YES, YES) OF_SETTER(_authzid, authzid, true, 1)
} }
- (OFString*)authzid - (OFString*)authzid
{ {
OF_GETTER(_authzid, YES) OF_GETTER(_authzid, true)
} }
- (void)setAuthcid: (OFString*)authcid - (void)setAuthcid: (OFString*)authcid
{ {
OF_SETTER(_authcid, authcid, YES, YES) OF_SETTER(_authcid, authcid, true, 1)
} }
- (OFString*)authcid - (OFString*)authcid
{ {
OF_GETTER(_authcid, YES) OF_GETTER(_authcid, true)
} }
- (void)setPassword: (OFString*)password - (void)setPassword: (OFString*)password
{ {
OF_SETTER(_password, password, YES, YES) OF_SETTER(_password, password, true, 1)
} }
- (OFString*)password - (OFString*)password
{ {
OF_GETTER(_password, YES) OF_GETTER(_password, true)
} }
- (OFDataArray*)initialMessage - (OFDataArray*)initialMessage

View file

@ -87,7 +87,7 @@
* \param connection The connection that received the stanza * \param connection The connection that received the stanza
* \param iq The IQ stanza that was received * \param iq The IQ stanza that was received
*/ */
- (BOOL)connection: (XMPPConnection*)connection - (bool)connection: (XMPPConnection*)connection
didReceiveIQ: (XMPPIQ*)iq; didReceiveIQ: (XMPPIQ*)iq;
/** /**
@ -166,11 +166,11 @@
XMPPMulticastDelegate *_delegates; XMPPMulticastDelegate *_delegates;
OFMutableDictionary *_callbacks; OFMutableDictionary *_callbacks;
XMPPAuthenticator *_authModule; XMPPAuthenticator *_authModule;
BOOL _streamOpen; bool _streamOpen;
BOOL _needsSession; bool _needsSession;
BOOL _encryptionRequired, _encrypted; bool _encryptionRequired, _encrypted;
BOOL _supportsRosterVersioning; bool _supportsRosterVersioning;
BOOL _supportsStreamManagement; bool _supportsStreamManagement;
unsigned int _lastID; unsigned int _lastID;
} }
@ -204,13 +204,13 @@
/// \brief The socket used for the connection /// \brief The socket used for the connection
@property (readonly, retain) OFTCPSocket *socket; @property (readonly, retain) OFTCPSocket *socket;
/// \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 Whether roster versioning is supported /// \brief Whether roster versioning is supported
@property (readonly) BOOL supportsRosterVersioning; @property (readonly) bool supportsRosterVersioning;
/// \brief Whether stream management is supported /// \brief Whether stream management is supported
@property (readonly) BOOL supportsStreamManagement; @property (readonly) bool supportsStreamManagement;
#endif #endif
/** /**
@ -253,7 +253,7 @@
* Passing NULL means the reason is not stored anywhere. * Passing NULL means the reason is not stored anywhere.
* \return Whether the certificate is valid * \return Whether the certificate is valid
*/ */
- (BOOL)checkCertificateAndGetReason: (OFString**)reason; - (bool)checkCertificateAndGetReason: (OFString**)reason;
/** /**
* \brief Adds the connection to the run loop. * \brief Adds the connection to the run loop.
@ -290,21 +290,21 @@
* *
* \return Whether encryption is encrypted * \return Whether encryption is encrypted
*/ */
- (BOOL)encryptionRequired; - (bool)encryptionRequired;
/** /**
* \brief Sets whether encryption is required. * \brief Sets whether encryption is required.
* *
* \param required 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. * \brief Returns whether the connection is encrypted.
* *
* \return Whether the connection is encrypted * \return Whether the connection is encrypted
*/ */
- (BOOL)encrypted; - (bool)encrypted;
/** /**
* \brief Sends an OFXMLElement, usually an XMPPStanza. * \brief Sends an OFXMLElement, usually an XMPPStanza.
@ -360,8 +360,8 @@
- (id <XMPPStorage>)dataStorage; - (id <XMPPStorage>)dataStorage;
- (void)setLanguage: (OFString*)language; - (void)setLanguage: (OFString*)language;
- (OFString*)language; - (OFString*)language;
- (BOOL)supportsRosterVersioning; - (bool)supportsRosterVersioning;
- (BOOL)supportsStreamManagement; - (bool)supportsStreamManagement;
- (void)XMPP_startStream; - (void)XMPP_startStream;
- (void)XMPP_handleStream: (OFXMLElement*)element; - (void)XMPP_handleStream: (OFXMLElement*)element;

View file

@ -108,7 +108,7 @@
[self performSelector: @selector(didConnect) [self performSelector: @selector(didConnect)
onThread: sourceThread onThread: sourceThread
waitUntilDone: NO]; waitUntilDone: false];
[pool release]; [pool release];
@ -128,8 +128,6 @@
@try { @try {
_port = 5222; _port = 5222;
_encrypted = NO;
_streamOpen = NO;
_delegates = [[XMPPMulticastDelegate alloc] init]; _delegates = [[XMPPMulticastDelegate alloc] init];
_callbacks = [[OFMutableDictionary alloc] init]; _callbacks = [[OFMutableDictionary alloc] init];
} @catch (id e) { } @catch (id e) {
@ -309,22 +307,22 @@
- (void)setPrivateKeyFile: (OFString*)privateKeyFile - (void)setPrivateKeyFile: (OFString*)privateKeyFile
{ {
OF_SETTER(_privateKeyFile, privateKeyFile, YES, YES) OF_SETTER(_privateKeyFile, privateKeyFile, true, 1)
} }
- (OFString*)privateKeyFile - (OFString*)privateKeyFile
{ {
OF_GETTER(_privateKeyFile, YES) OF_GETTER(_privateKeyFile, true)
} }
- (void)setCertificateFile: (OFString*)certificateFile - (void)setCertificateFile: (OFString*)certificateFile
{ {
OF_SETTER(_certificateFile, certificateFile, YES, YES) OF_SETTER(_certificateFile, certificateFile, true, 1)
} }
- (OFString*)certificateFile - (OFString*)certificateFile
{ {
OF_GETTER(_certificateFile, YES) OF_GETTER(_certificateFile, true)
} }
- (void)connect - (void)connect
@ -397,13 +395,13 @@
[pool release]; [pool release];
} }
- (BOOL)XMPP_parseBuffer: (const void*)buffer - (bool)XMPP_parseBuffer: (const void*)buffer
length: (size_t)length length: (size_t)length
{ {
if ([_socket isAtEndOfStream]) { if ([_socket isAtEndOfStream]) {
[_delegates broadcastSelector: @selector(connectionWasClosed:) [_delegates broadcastSelector: @selector(connectionWasClosed:)
withObject: self]; withObject: self];
return NO; return false;
} }
@try { @try {
@ -413,10 +411,10 @@
[self XMPP_sendStreamError: @"bad-format" [self XMPP_sendStreamError: @"bad-format"
text: nil]; text: nil];
[self close]; [self close];
return NO; return false;
} }
return YES; return true;
} }
- (void)parseBuffer: (const void*)buffer - (void)parseBuffer: (const void*)buffer
@ -432,7 +430,7 @@
_oldElementBuilder = nil; _oldElementBuilder = nil;
} }
- (BOOL)stream: (OFStream*)stream - (bool)stream: (OFStream*)stream
didReadIntoBuffer: (char*)buffer didReadIntoBuffer: (char*)buffer
length: (size_t)length length: (size_t)length
exception: (OFException*)exception exception: (OFException*)exception
@ -443,20 +441,20 @@
withObject: self withObject: self
withObject: exception]; withObject: exception];
[self close]; [self close];
return NO; return false;
} }
@try { @try {
if (![self XMPP_parseBuffer: buffer if (![self XMPP_parseBuffer: buffer
length: length]) length: length])
return NO; return false;
} @catch (id e) { } @catch (id e) {
[_delegates broadcastSelector: @selector(connection: [_delegates broadcastSelector: @selector(connection:
didThrowException:) didThrowException:)
withObject: self withObject: self
withObject: e]; withObject: e];
[self close]; [self close];
return NO; return false;
} }
if (_oldParser != nil || _oldElementBuilder != nil) { if (_oldParser != nil || _oldElementBuilder != nil) {
@ -473,10 +471,10 @@
didReadIntoBuffer:length: didReadIntoBuffer:length:
exception:)]; exception:)];
return NO; return false;
} }
return YES; return true;
} }
- (OFTCPSocket*)socket - (OFTCPSocket*)socket
@ -484,41 +482,41 @@
return [[_socket retain] autorelease]; return [[_socket retain] autorelease];
} }
- (BOOL)encryptionRequired - (bool)encryptionRequired
{ {
return _encryptionRequired; return _encryptionRequired;
} }
- (void)setEncryptionRequired: (BOOL)encryptionRequired - (void)setEncryptionRequired: (bool)encryptionRequired
{ {
_encryptionRequired = encryptionRequired; _encryptionRequired = encryptionRequired;
} }
- (BOOL)encrypted - (bool)encrypted
{ {
return _encrypted; return _encrypted;
} }
- (BOOL)streamOpen - (bool)streamOpen
{ {
return _streamOpen; return _streamOpen;
} }
- (BOOL)supportsRosterVersioning - (bool)supportsRosterVersioning
{ {
return _supportsRosterVersioning; return _supportsRosterVersioning;
} }
- (BOOL)supportsStreamManagement - (bool)supportsStreamManagement
{ {
return _supportsStreamManagement; return _supportsStreamManagement;
} }
- (BOOL)checkCertificateAndGetReason: (OFString**)reason - (bool)checkCertificateAndGetReason: (OFString**)reason
{ {
X509Certificate *cert; X509Certificate *cert;
OFDictionary *SANs; OFDictionary *SANs;
BOOL serviceSpecific = NO; bool serviceSpecific = false;
@try { @try {
[_socket verifyPeerCertificate]; [_socket verifyPeerCertificate];
@ -526,7 +524,7 @@
if (reason != NULL) if (reason != NULL)
*reason = [[[e reason] copy] autorelease]; *reason = [[[e reason] copy] autorelease];
return NO; return false;
} }
cert = [_socket peerCertificate]; cert = [_socket peerCertificate];
@ -536,18 +534,18 @@
objectForKey: OID_SRVName] != nil || objectForKey: OID_SRVName] != nil ||
[SANs objectForKey: @"dNSName"] != nil || [SANs objectForKey: @"dNSName"] != nil ||
[SANs objectForKey: @"uniformResourceIdentifier"] != nil) [SANs objectForKey: @"uniformResourceIdentifier"] != nil)
serviceSpecific = YES; serviceSpecific = true;
if ([cert hasSRVNameMatchingDomain: _domainToASCII if ([cert hasSRVNameMatchingDomain: _domainToASCII
service: @"xmpp-client"] || service: @"xmpp-client"] ||
[cert hasDNSNameMatchingDomain: _domainToASCII]) [cert hasDNSNameMatchingDomain: _domainToASCII])
return YES; return true;
if (!serviceSpecific && if (!serviceSpecific &&
[cert hasCommonNameMatchingDomain: _domainToASCII]) [cert hasCommonNameMatchingDomain: _domainToASCII])
return YES; return true;
return NO; return false;
} }
- (void)sendStanza: (OFXMLElement*)element - (void)sendStanza: (OFXMLElement*)element
@ -723,7 +721,7 @@
@"xmlns:stream='" XMPP_NS_STREAM @"' %@" @"xmlns:stream='" XMPP_NS_STREAM @"' %@"
@"version='1.0'>", _domain, langString]; @"version='1.0'>", _domain, langString];
_streamOpen = YES; _streamOpen = true;
} }
- (void)close - (void)close
@ -742,8 +740,8 @@
_socket = nil; _socket = nil;
[_JID release]; [_JID release];
_JID = nil; _JID = nil;
_streamOpen = _needsSession = _encrypted = NO; _streamOpen = _needsSession = _encrypted = false;
_supportsRosterVersioning = _supportsStreamManagement = NO; _supportsRosterVersioning = _supportsStreamManagement = false;
_lastID = 0; _lastID = 0;
} }
@ -893,7 +891,7 @@
[_socket release]; [_socket release];
_socket = newSock; _socket = newSock;
_encrypted = YES; _encrypted = true;
[_delegates broadcastSelector: @selector( [_delegates broadcastSelector: @selector(
connectionDidUpgradeToTLS:) connectionDidUpgradeToTLS:)
@ -962,7 +960,7 @@
- (void)XMPP_handleIQ: (XMPPIQ*)iq - (void)XMPP_handleIQ: (XMPPIQ*)iq
{ {
BOOL handled = NO; bool handled = false;
XMPPCallback *callback; XMPPCallback *callback;
if ((callback = [_callbacks objectForKey: [iq ID]])) { if ((callback = [_callbacks objectForKey: [iq ID]])) {
@ -1023,11 +1021,11 @@
if ([element elementForName: @"ver" if ([element elementForName: @"ver"
namespace: XMPP_NS_ROSTERVER] != nil) namespace: XMPP_NS_ROSTERVER] != nil)
_supportsRosterVersioning = YES; _supportsRosterVersioning = true;
if ([element elementForName: @"sm" if ([element elementForName: @"sm"
namespace: XMPP_NS_SM] != nil) namespace: XMPP_NS_SM] != nil)
_supportsStreamManagement = YES; _supportsStreamManagement = true;
if (mechs != nil) { if (mechs != nil) {
OFEnumerator *enumerator; OFEnumerator *enumerator;
@ -1050,7 +1048,7 @@
password: _password password: _password
connection: self connection: self
hash: [OFSHA1Hash class] hash: [OFSHA1Hash class]
plusAvailable: YES]; plusAvailable: true];
[self XMPP_sendAuth: @"SCRAM-SHA-1-PLUS"]; [self XMPP_sendAuth: @"SCRAM-SHA-1-PLUS"];
return; return;
} }
@ -1061,7 +1059,7 @@
password: _password password: _password
connection: self connection: self
hash: [OFSHA1Hash class] hash: [OFSHA1Hash class]
plusAvailable: NO]; plusAvailable: false];
[self XMPP_sendAuth: @"SCRAM-SHA-1"]; [self XMPP_sendAuth: @"SCRAM-SHA-1"];
return; return;
} }
@ -1078,7 +1076,7 @@
} }
if (session != nil) if (session != nil)
_needsSession = YES; _needsSession = true;
if (bind != nil) { if (bind != nil) {
[self XMPP_sendResourceBind]; [self XMPP_sendResourceBind];
@ -1256,12 +1254,12 @@
- (void)setLanguage: (OFString*)language - (void)setLanguage: (OFString*)language
{ {
OF_SETTER(_language, language, YES, YES) OF_SETTER(_language, language, true, 1)
} }
- (OFString*)language - (OFString*)language
{ {
OF_GETTER(_language, YES) OF_GETTER(_language, true)
} }
- (void)addDelegate: (id <XMPPConnectionDelegate>)delegate - (void)addDelegate: (id <XMPPConnectionDelegate>)delegate

View file

@ -48,12 +48,12 @@
- (XMPPRosterItem*)rosterItem - (XMPPRosterItem*)rosterItem
{ {
OF_GETTER(_rosterItem, YES); OF_GETTER(_rosterItem, true)
} }
- (OFDictionary*)presences - (OFDictionary*)presences
{ {
OF_GETTER(_presences, YES); OF_GETTER(_presences, true)
} }
- (void)sendMessage: (XMPPMessage*)message - (void)sendMessage: (XMPPMessage*)message
@ -69,7 +69,7 @@
- (void)XMPP_setRosterItem: (XMPPRosterItem*)rosterItem - (void)XMPP_setRosterItem: (XMPPRosterItem*)rosterItem
{ {
OF_SETTER(_rosterItem, rosterItem, YES, 0); OF_SETTER(_rosterItem, rosterItem, true, 0);
} }
- (void)XMPP_setPresence: (XMPPPresence*)presence - (void)XMPP_setPresence: (XMPPPresence*)presence
@ -82,7 +82,7 @@
[_presences setObject: presence [_presences setObject: presence
forKey: @""]; forKey: @""];
OF_SETTER(_lockedOnJID, nil, YES, 0); [self XMPP_setLockedOnJID: nil];
} }
- (void)XMPP_removePresenceForResource: (OFString*)resource - (void)XMPP_removePresenceForResource: (OFString*)resource
@ -94,11 +94,11 @@
_presences = [[OFMutableDictionary alloc] init]; _presences = [[OFMutableDictionary alloc] init];
} }
OF_SETTER(_lockedOnJID, nil, YES, 0); [self XMPP_setLockedOnJID: nil];
} }
- (void)XMPP_setLockedOnJID: (XMPPJID*)JID; - (void)XMPP_setLockedOnJID: (XMPPJID*)JID;
{ {
OF_SETTER(_lockedOnJID, JID, YES, 0); OF_SETTER(_lockedOnJID, JID, true, 0);
} }
@end @end

View file

@ -86,7 +86,7 @@
- (OFDictionary*)contacts - (OFDictionary*)contacts
{ {
OF_GETTER(_contacts, YES); OF_GETTER(_contacts, true)
} }
- (void)rosterWasReceived: (XMPPRoster*)roster_ - (void)rosterWasReceived: (XMPPRoster*)roster_

View file

@ -74,7 +74,7 @@
- (OFDictionary*)discoNodes; - (OFDictionary*)discoNodes;
{ {
OF_GETTER(_discoNodes, YES); OF_GETTER(_discoNodes, true)
} }
- (void)addDiscoNode: (XMPPDiscoNode*)node - (void)addDiscoNode: (XMPPDiscoNode*)node
@ -85,7 +85,7 @@
- (OFString*)capsNode - (OFString*)capsNode
{ {
OF_GETTER(_capsNode, YES); OF_GETTER(_capsNode, true)
} }
- (OFString*)capsHash - (OFString*)capsHash
@ -121,11 +121,11 @@
_JID = [JID copy]; _JID = [JID copy];
} }
- (BOOL)connection: (XMPPConnection*)connection - (bool)connection: (XMPPConnection*)connection
didReceiveIQ: (XMPPIQ*)IQ didReceiveIQ: (XMPPIQ*)IQ
{ {
if (![[IQ to] isEqual: _JID]) if (![[IQ to] isEqual: _JID])
return NO; return false;
OFXMLElement *query = [IQ elementForName: @"query" OFXMLElement *query = [IQ elementForName: @"query"
namespace: XMPP_NS_DISCO_ITEMS]; namespace: XMPP_NS_DISCO_ITEMS];
@ -142,7 +142,7 @@
return [responder XMPP_handleItemsIQ: IQ return [responder XMPP_handleItemsIQ: IQ
connection: connection]; connection: connection];
return NO; return false;
} }
query = [IQ elementForName: @"query" query = [IQ elementForName: @"query"
@ -167,9 +167,9 @@
return [responder XMPP_handleInfoIQ: IQ return [responder XMPP_handleInfoIQ: IQ
connection: connection]; connection: connection];
return NO; return false;
} }
return NO; return false;
} }
@end @end

View file

@ -91,17 +91,17 @@
- (OFString*)category - (OFString*)category
{ {
OF_GETTER(_category, YES); OF_GETTER(_category, true)
} }
- (OFString*)name - (OFString*)name
{ {
OF_GETTER(_name, YES); OF_GETTER(_name, true)
} }
- (OFString*)type - (OFString*)type
{ {
OF_GETTER(_type, YES); OF_GETTER(_type, true)
} }
- (bool)isEqual: (id)object - (bool)isEqual: (id)object
@ -109,19 +109,19 @@
XMPPDiscoIdentity *identity; XMPPDiscoIdentity *identity;
if (object == self) if (object == self)
return YES; return true;
if (![object isKindOfClass: [XMPPDiscoIdentity class]]) if (![object isKindOfClass: [XMPPDiscoIdentity class]])
return NO; return false;
identity = object; identity = object;
if ([_category isEqual: identity->_category] && if ([_category isEqual: identity->_category] &&
(_name == identity->_name || [_name isEqual: identity->_name]) && (_name == identity->_name || [_name isEqual: identity->_name]) &&
[_type isEqual: identity->_type]) [_type isEqual: identity->_type])
return YES; return true;
return NO; return false;
} }
- (uint32_t)hash - (uint32_t)hash

View file

@ -128,8 +128,8 @@
- (OFSortedList*)features; - (OFSortedList*)features;
- (OFDictionary*)childNodes; - (OFDictionary*)childNodes;
- (BOOL)XMPP_handleItemsIQ: (XMPPIQ*)IQ - (bool)XMPP_handleItemsIQ: (XMPPIQ*)IQ
connection: (XMPPConnection*)connection; connection: (XMPPConnection*)connection;
- (BOOL)XMPP_handleInfoIQ: (XMPPIQ*)IQ - (bool)XMPP_handleInfoIQ: (XMPPIQ*)IQ
connection: (XMPPConnection*)connection; connection: (XMPPConnection*)connection;
@end @end

View file

@ -94,32 +94,32 @@
- (XMPPJID*)JID - (XMPPJID*)JID
{ {
OF_GETTER(_JID, YES); OF_GETTER(_JID, true)
} }
- (OFString*)node - (OFString*)node
{ {
OF_GETTER(_node, YES); OF_GETTER(_node, true)
} }
- (OFString*)name - (OFString*)name
{ {
OF_GETTER(_name, YES); OF_GETTER(_name, true)
} }
- (OFSortedList*)identities - (OFSortedList*)identities
{ {
OF_GETTER(_identities, YES); OF_GETTER(_identities, true)
} }
- (OFSortedList*)features - (OFSortedList*)features
{ {
OF_GETTER(_features, YES); OF_GETTER(_features, true)
} }
- (OFDictionary*)childNodes - (OFDictionary*)childNodes
{ {
OF_GETTER(_childNodes, YES); OF_GETTER(_childNodes, true)
} }
- (void)addIdentity: (XMPPDiscoIdentity*)identity - (void)addIdentity: (XMPPDiscoIdentity*)identity
@ -138,7 +138,7 @@
forKey: [node node]]; forKey: [node node]];
} }
- (BOOL)XMPP_handleItemsIQ: (XMPPIQ*)IQ - (bool)XMPP_handleItemsIQ: (XMPPIQ*)IQ
connection: (XMPPConnection*)connection connection: (XMPPConnection*)connection
{ {
XMPPIQ *resultIQ; XMPPIQ *resultIQ;
@ -150,7 +150,7 @@
OFString *node = [[query attributeForName: @"node"] stringValue]; OFString *node = [[query attributeForName: @"node"] stringValue];
if (!(node == _node) && ![node isEqual: _node]) if (!(node == _node) && ![node isEqual: _node])
return NO; return false;
resultIQ = [IQ resultIQ]; resultIQ = [IQ resultIQ];
response = [OFXMLElement elementWithName: @"query" response = [OFXMLElement elementWithName: @"query"
@ -177,10 +177,10 @@
[connection sendStanza: resultIQ]; [connection sendStanza: resultIQ];
return YES; return true;
} }
- (BOOL)XMPP_handleInfoIQ: (XMPPIQ*)IQ - (bool)XMPP_handleInfoIQ: (XMPPIQ*)IQ
connection: (XMPPConnection*)connection connection: (XMPPConnection*)connection
{ {
XMPPIQ *resultIQ; XMPPIQ *resultIQ;
@ -223,6 +223,6 @@
[connection sendStanza: resultIQ]; [connection sendStanza: resultIQ];
return YES; return true;
} }
@end @end

View file

@ -154,7 +154,7 @@
return string; return string;
} }
- (void)setBooleanValue: (BOOL)boolean - (void)setBooleanValue: (bool)boolean
forPath: (OFString*)path forPath: (OFString*)path
{ {
OFAutoreleasePool *pool = [OFAutoreleasePool new]; OFAutoreleasePool *pool = [OFAutoreleasePool new];
@ -165,10 +165,10 @@
[pool release]; [pool release];
} }
- (BOOL)booleanValueForPath: (OFString*)path - (bool)booleanValueForPath: (OFString*)path
{ {
OFAutoreleasePool *pool = [OFAutoreleasePool new]; OFAutoreleasePool *pool = [OFAutoreleasePool new];
BOOL boolean; bool boolean;
boolean = [[self XMPP_objectForPath: path] boolValue]; boolean = [[self XMPP_objectForPath: path] boolValue];

View file

@ -231,21 +231,20 @@
XMPPJID *JID; XMPPJID *JID;
if (object == self) if (object == self)
return YES; return true;
if (![object isKindOfClass: [XMPPJID class]]) if (![object isKindOfClass: [XMPPJID class]])
return NO; return false;
JID = object; JID = object;
// Node and resource may be nil // Node and resource may be nil
if ((_node == JID->_node || [_node isEqual: JID->_node]) && if ((_node == JID->_node || [_node isEqual: JID->_node]) &&
[_domain isEqual: JID->_domain] && [_domain isEqual: JID->_domain] && (_resource == JID->_resource ||
(_resource == JID->_resource || [_resource isEqual: JID->_resource]) [_resource isEqual: JID->_resource]))
) return true;
return YES;
return NO; return false;
} }
- (uint32_t)hash - (uint32_t)hash

View file

@ -52,7 +52,7 @@
* \param selector The selector to broadcast * \param selector The selector to broadcast
* \param object The object to broadcast * \param object The object to broadcast
*/ */
- (BOOL)broadcastSelector: (SEL)selector - (bool)broadcastSelector: (SEL)selector
withObject: (id)object; withObject: (id)object;
/** /**
@ -62,7 +62,7 @@
* \param object1 The first object to broadcast * \param object1 The first object to broadcast
* \param object2 The second object to broadcast * \param object2 The second object to broadcast
*/ */
- (BOOL)broadcastSelector: (SEL)selector - (bool)broadcastSelector: (SEL)selector
withObject: (id)object1 withObject: (id)object1
withObject: (id)object2; withObject: (id)object2;
@end @end

View file

@ -70,13 +70,13 @@
} }
} }
- (BOOL)broadcastSelector: (SEL)selector - (bool)broadcastSelector: (SEL)selector
withObject: (id)object withObject: (id)object
{ {
OFDataArray *currentDelegates = [_delegates copy]; OFDataArray *currentDelegates = [_delegates copy];
id *items = [currentDelegates items]; id *items = [currentDelegates items];
size_t i, count = [currentDelegates count]; size_t i, count = [currentDelegates count];
BOOL handled = NO; bool handled = false;
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
id responder = items[i]; id responder = items[i];
@ -84,7 +84,7 @@
if (![responder respondsToSelector: selector]) if (![responder respondsToSelector: selector])
continue; continue;
BOOL (*imp)(id, SEL, id) = (BOOL(*)(id, SEL, id)) bool (*imp)(id, SEL, id) = (bool(*)(id, SEL, id))
[responder methodForSelector: selector]; [responder methodForSelector: selector];
handled |= imp(responder, selector, object); handled |= imp(responder, selector, object);
@ -93,14 +93,14 @@
return handled; return handled;
} }
- (BOOL)broadcastSelector: (SEL)selector - (bool)broadcastSelector: (SEL)selector
withObject: (id)object1 withObject: (id)object1
withObject: (id)object2 withObject: (id)object2
{ {
OFDataArray *currentDelegates = [_delegates copy]; OFDataArray *currentDelegates = [_delegates copy];
id *items = [currentDelegates items]; id *items = [currentDelegates items];
size_t i, count = [currentDelegates count]; size_t i, count = [currentDelegates count];
BOOL handled = NO; bool handled = false;
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
id responder = items[i]; id responder = items[i];
@ -108,7 +108,7 @@
if (![responder respondsToSelector: selector]) if (![responder respondsToSelector: selector])
continue; 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]; [responder methodForSelector: selector];
handled |= imp(responder, selector, object1, object2); handled |= imp(responder, selector, object1, object2);

View file

@ -150,7 +150,7 @@ static int show_to_int(OFString *show)
namespace: XMPP_NS_CLIENT namespace: XMPP_NS_CLIENT
stringValue: show]]; stringValue: show]];
OF_SETTER(_show, show, YES, 1); OF_SETTER(_show, show, true, 1)
} }
- (OFString*)show - (OFString*)show
@ -171,7 +171,7 @@ static int show_to_int(OFString *show)
namespace: XMPP_NS_CLIENT namespace: XMPP_NS_CLIENT
stringValue: status]]; stringValue: status]];
OF_SETTER(_status, status, YES, 1); OF_SETTER(_status, status, true, 1)
} }
- (OFString*)status - (OFString*)status
@ -198,7 +198,7 @@ static int show_to_int(OFString *show)
namespace: XMPP_NS_CLIENT namespace: XMPP_NS_CLIENT
stringValue: priority_s]]; stringValue: priority_s]];
OF_SETTER(_priority, priority, YES, 1); OF_SETTER(_priority, priority, true, 1)
} }
- (OFNumber*)priority - (OFNumber*)priority

View file

@ -72,7 +72,7 @@
OFMutableDictionary *_rosterItems; OFMutableDictionary *_rosterItems;
XMPPMulticastDelegate *_delegates; XMPPMulticastDelegate *_delegates;
id <XMPPStorage> _dataStorage; id <XMPPStorage> _dataStorage;
BOOL _rosterRequested; bool _rosterRequested;
} }
#ifdef OF_HAVE_PROPERTIES #ifdef OF_HAVE_PROPERTIES

View file

@ -77,7 +77,7 @@
XMPPIQ *iq; XMPPIQ *iq;
OFXMLElement *query; OFXMLElement *query;
_rosterRequested = YES; _rosterRequested = true;
iq = [XMPPIQ IQWithType: @"get" iq = [XMPPIQ IQWithType: @"get"
ID: [_connection generateStanzaID]]; ID: [_connection generateStanzaID]];
@ -86,7 +86,8 @@
namespace: XMPP_NS_ROSTER]; namespace: XMPP_NS_ROSTER];
if ([_connection supportsRosterVersioning]) { if ([_connection supportsRosterVersioning]) {
OFString *ver = [_dataStorage stringValueForPath: @"roster.ver"]; OFString *ver =
[_dataStorage stringValueForPath: @"roster.ver"];
if (ver == nil) if (ver == nil)
ver = @""; ver = @"";
@ -103,7 +104,7 @@
IQ:)]; IQ:)];
} }
- (BOOL)connection: (XMPPConnection*)connection - (bool)connection: (XMPPConnection*)connection
didReceiveIQ: (XMPPIQ*)iq didReceiveIQ: (XMPPIQ*)iq
{ {
OFXMLElement *rosterElement; OFXMLElement *rosterElement;
@ -114,10 +115,10 @@
namespace: XMPP_NS_ROSTER]; namespace: XMPP_NS_ROSTER];
if (rosterElement == nil) if (rosterElement == nil)
return NO; return false;
if (![[iq type] isEqual: @"set"]) if (![[iq type] isEqual: @"set"])
return NO; return false;
element = [rosterElement elementForName: @"item" element = [rosterElement elementForName: @"item"
namespace: XMPP_NS_ROSTER]; namespace: XMPP_NS_ROSTER];
@ -143,7 +144,7 @@
[connection sendStanza: [iq resultIQ]]; [connection sendStanza: [iq resultIQ]];
return YES; return true;
} }
- (void)addRosterItem: (XMPPRosterItem*)rosterItem - (void)addRosterItem: (XMPPRosterItem*)rosterItem

View file

@ -71,41 +71,41 @@
- (void)setJID: (XMPPJID*)JID - (void)setJID: (XMPPJID*)JID
{ {
OF_SETTER(_JID, JID, YES, YES) OF_SETTER(_JID, JID, true, 1)
} }
- (XMPPJID*)JID - (XMPPJID*)JID
{ {
OF_GETTER(_JID, YES) OF_GETTER(_JID, true)
} }
- (void)setName: (OFString*)name - (void)setName: (OFString*)name
{ {
OF_SETTER(_name, name, YES, YES) OF_SETTER(_name, name, true, 1)
} }
- (OFString*)name - (OFString*)name
{ {
OF_GETTER(_name, YES) OF_GETTER(_name, true)
} }
- (void)setSubscription: (OFString*)subscription - (void)setSubscription: (OFString*)subscription
{ {
OF_SETTER(_subscription, subscription, YES, YES) OF_SETTER(_subscription, subscription, true, 1)
} }
- (OFString*)subscription - (OFString*)subscription
{ {
OF_GETTER(_subscription, YES) OF_GETTER(_subscription, true)
} }
- (void)setGroups: (OFArray*)groups - (void)setGroups: (OFArray*)groups
{ {
OF_SETTER(_groups, groups, YES, YES) OF_SETTER(_groups, groups, true, 1)
} }
- (OFArray*)groups - (OFArray*)groups
{ {
OF_GETTER(_groups, YES) OF_GETTER(_groups, true)
} }
@end @end

View file

@ -35,8 +35,8 @@
OFString *_clientFirstMessageBare; OFString *_clientFirstMessageBare;
OFDataArray *_serverSignature; OFDataArray *_serverSignature;
XMPPConnection *_connection; XMPPConnection *_connection;
BOOL _plusAvailable; bool _plusAvailable;
BOOL _authenticated; bool _authenticated;
} }
/** /**
@ -53,7 +53,7 @@
password: (OFString*)password password: (OFString*)password
connection: (XMPPConnection*)connection connection: (XMPPConnection*)connection
hash: (Class)hash hash: (Class)hash
plusAvailable: (BOOL)plusAvailable; plusAvailable: (bool)plusAvailable;
/** /**
* \brief Creates a new autoreleased XMPPSCRAMAuth with an authzid, authcid and * \brief Creates a new autoreleased XMPPSCRAMAuth with an authzid, authcid and
@ -72,7 +72,7 @@
password: (OFString*)password password: (OFString*)password
connection: (XMPPConnection*)connection connection: (XMPPConnection*)connection
hash: (Class)hash hash: (Class)hash
plusAvailable: (BOOL)plusAvailable; plusAvailable: (bool)plusAvailable;
/** /**
* \brief Initializes an already allocated XMPPSCRAMAuth with an authcid and * \brief Initializes an already allocated XMPPSCRAMAuth with an authcid and
@ -89,7 +89,7 @@
password: (OFString*)password password: (OFString*)password
connection: (XMPPConnection*)connection connection: (XMPPConnection*)connection
hash: (Class)hash hash: (Class)hash
plusAvailable: (BOOL)plusAvailable; plusAvailable: (bool)plusAvailable;
/** /**
* \brief Initializes an already allocated XMPPSCRAMAuth with a authzid, * \brief Initializes an already allocated XMPPSCRAMAuth with a authzid,
@ -108,7 +108,7 @@
password: (OFString*)password password: (OFString*)password
connection: (XMPPConnection*)connection connection: (XMPPConnection*)connection
hash: (Class)hash hash: (Class)hash
plusAvailable: (BOOL)plusAvailable; plusAvailable: (bool)plusAvailable;
/// \cond internal /// \cond internal
- (OFString*)XMPP_genNonce; - (OFString*)XMPP_genNonce;

View file

@ -42,7 +42,7 @@
password: (OFString*)password password: (OFString*)password
connection: (XMPPConnection*)connection connection: (XMPPConnection*)connection
hash: (Class)hash hash: (Class)hash
plusAvailable: (BOOL)plusAvailable plusAvailable: (bool)plusAvailable
{ {
return [[[self alloc] initWithAuthcid: authcid return [[[self alloc] initWithAuthcid: authcid
password: password password: password
@ -56,7 +56,7 @@
password: (OFString*)password password: (OFString*)password
connection: (XMPPConnection*)connection connection: (XMPPConnection*)connection
hash: (Class)hash hash: (Class)hash
plusAvailable: (BOOL)plusAvailable plusAvailable: (bool)plusAvailable
{ {
return [[[self alloc] initWithAuthzid: authzid return [[[self alloc] initWithAuthzid: authzid
authcid: authcid authcid: authcid
@ -70,7 +70,7 @@
password: (OFString*)password password: (OFString*)password
connection: (XMPPConnection*)connection connection: (XMPPConnection*)connection
hash: (Class)hash hash: (Class)hash
plusAvailable: (BOOL)plusAvailable plusAvailable: (bool)plusAvailable
{ {
return [self initWithAuthzid: nil return [self initWithAuthzid: nil
authcid: authcid authcid: authcid
@ -85,7 +85,7 @@
password: (OFString*)password password: (OFString*)password
connection: (XMPPConnection*)connection connection: (XMPPConnection*)connection
hash: (Class)hash hash: (Class)hash
plusAvailable: (BOOL)plusAvailable plusAvailable: (bool)plusAvailable
{ {
self = [super initWithAuthzid: authzid self = [super initWithAuthzid: authzid
authcid: authcid authcid: authcid
@ -154,7 +154,7 @@
_GS2Header = nil; _GS2Header = nil;
[_serverSignature release]; [_serverSignature release];
_serverSignature = nil; _serverSignature = nil;
_authenticated = NO; _authenticated = false;
if (_authzid) if (_authzid)
_GS2Header = [[OFString alloc] _GS2Header = [[OFString alloc]
@ -390,7 +390,7 @@
exceptionWithConnection: nil exceptionWithConnection: nil
reason: @"Received wrong " reason: @"Received wrong "
@"ServerSignature"]; @"ServerSignature"];
_authenticated = YES; _authenticated = true;
} else } else
@throw [XMPPAuthFailedException exceptionWithConnection: nil @throw [XMPPAuthFailedException exceptionWithConnection: nil
reason: value]; reason: value];

View file

@ -86,7 +86,7 @@
OFList *list; OFList *list;
of_list_object_t *listIter; of_list_object_t *listIter;
OFList *subListCopy; OFList *subListCopy;
BOOL done; bool done;
} }
- initWithList: (OFList*)list; - initWithList: (OFList*)list;

View file

@ -158,7 +158,7 @@
- (OFString*)target - (OFString*)target
{ {
OF_GETTER(_target, YES) OF_GETTER(_target, true)
} }
@end @end
@ -195,7 +195,7 @@
- (OFString*)domain; - (OFString*)domain;
{ {
OF_GETTER(_domain, YES) OF_GETTER(_domain, true)
} }
- (void)XMPP_lookup - (void)XMPP_lookup
@ -366,7 +366,7 @@
listIter = listIter->next; listIter = listIter->next;
if (listIter == NULL) if (listIter == NULL)
done = YES; done = true;
} }
return ret; return ret;
@ -377,6 +377,6 @@
listIter = NULL; listIter = NULL;
[subListCopy release]; [subListCopy release];
subListCopy = nil; subListCopy = nil;
done = NO; done = false;
} }
@end @end

View file

@ -20,7 +20,7 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#include <stdint.h> #import <ObjFW/OFObject.h>
@class OFString; @class OFString;
@class OFArray; @class OFArray;
@ -31,9 +31,9 @@
- (void)setStringValue: (OFString*)string - (void)setStringValue: (OFString*)string
forPath: (OFString*)path; forPath: (OFString*)path;
- (OFString*)stringValueForPath: (OFString*)path; - (OFString*)stringValueForPath: (OFString*)path;
- (void)setBooleanValue: (BOOL)boolean - (void)setBooleanValue: (bool)boolean
forPath: (OFString*)path; forPath: (OFString*)path;
- (BOOL)booleanValueForPath: (OFString*)path; - (bool)booleanValueForPath: (OFString*)path;
- (void)setIntegerValue: (intmax_t)integer - (void)setIntegerValue: (intmax_t)integer
forPath: (OFString*)path; forPath: (OFString*)path;
- (intmax_t)integerValueForPath: (OFString*)path; - (intmax_t)integerValueForPath: (OFString*)path;

View file

@ -153,7 +153,7 @@ OF_APPLICATION_DELEGATE(AppDelegate)
{ {
of_log(@"Bound to JID: %@", [jid fullJID]); of_log(@"Bound to JID: %@", [jid fullJID]);
of_log(@"Supports SM: %@", of_log(@"Supports SM: %@",
[conn_ supportsStreamManagement] ? @"YES" : @"NO"); [conn_ supportsStreamManagement] ? @"true" : @"false");
XMPPDiscoEntity *discoEntity = XMPPDiscoEntity *discoEntity =
[[XMPPDiscoEntity alloc] initWithConnection: conn]; [[XMPPDiscoEntity alloc] initWithConnection: conn];
@ -244,7 +244,7 @@ OF_APPLICATION_DELEGATE(AppDelegate)
of_log(@"Got roster push: %@", rosterItem); of_log(@"Got roster push: %@", rosterItem);
} }
- (BOOL)connection: (XMPPConnection*)conn - (bool)connection: (XMPPConnection*)conn
didReceiveIQ: (XMPPIQ*)iq didReceiveIQ: (XMPPIQ*)iq
{ {
of_log(@"IQ: %@", iq); of_log(@"IQ: %@", iq);