diff --git a/Core/XMPPModule.m b/Core/XMPPModule.m index b5418757c9..9733366931 100644 --- a/Core/XMPPModule.m +++ b/Core/XMPPModule.m @@ -65,16 +65,16 @@ - (BOOL)activate:(XMPPStream *)aXmppStream dispatch_block_t block = ^{ - if (xmppStream != nil) + if (self->xmppStream != nil) { result = NO; } else { - xmppStream = aXmppStream; + self->xmppStream = aXmppStream; - [xmppStream addDelegate:self delegateQueue:moduleQueue]; - [xmppStream registerModule:self]; + [self->xmppStream addDelegate:self delegateQueue:self->moduleQueue]; + [self->xmppStream registerModule:self]; [self didActivate]; } @@ -115,14 +115,14 @@ - (void)deactivate { dispatch_block_t block = ^{ - if (xmppStream) + if (self->xmppStream) { [self willDeactivate]; - [xmppStream removeDelegate:self delegateQueue:moduleQueue]; - [xmppStream unregisterModule:self]; + [self->xmppStream removeDelegate:self delegateQueue:self->moduleQueue]; + [self->xmppStream unregisterModule:self]; - xmppStream = nil; + self->xmppStream = nil; } }; @@ -165,7 +165,7 @@ - (XMPPStream *)xmppStream __block XMPPStream *result; dispatch_sync(moduleQueue, ^{ - result = xmppStream; + result = self->xmppStream; }); return result; @@ -177,7 +177,7 @@ - (void)addDelegate:(id)delegate delegateQueue:(dispatch_queue_t)delegateQueue // Asynchronous operation (if outside xmppQueue) dispatch_block_t block = ^{ - [multicastDelegate addDelegate:delegate delegateQueue:delegateQueue]; + [self->multicastDelegate addDelegate:delegate delegateQueue:delegateQueue]; }; if (dispatch_get_specific(moduleQueueTag)) @@ -189,7 +189,7 @@ - (void)addDelegate:(id)delegate delegateQueue:(dispatch_queue_t)delegateQueue - (void)removeDelegate:(id)delegate delegateQueue:(dispatch_queue_t)delegateQueue synchronously:(BOOL)synchronously { dispatch_block_t block = ^{ - [multicastDelegate removeDelegate:delegate delegateQueue:delegateQueue]; + [self->multicastDelegate removeDelegate:delegate delegateQueue:delegateQueue]; }; if (dispatch_get_specific(moduleQueueTag)) diff --git a/Core/XMPPParser.m b/Core/XMPPParser.m index 79dbb164f7..c480b96553 100644 --- a/Core/XMPPParser.m +++ b/Core/XMPPParser.m @@ -792,14 +792,14 @@ - (void)setDelegate:(id)newDelegate delegateQueue:(dispatch_queue_t)newDelegateQ dispatch_block_t block = ^{ - delegate = newDelegate; + self->delegate = newDelegate; #if !OS_OBJECT_USE_OBJC if (delegateQueue) dispatch_release(delegateQueue); #endif - delegateQueue = newDelegateQueue; + self->delegateQueue = newDelegateQueue; }; if (dispatch_get_specific(xmppParserQueueTag)) @@ -812,15 +812,15 @@ - (void)parseData:(NSData *)data { dispatch_block_t block = ^{ @autoreleasepool { - int result = xmlParseChunk(parserCtxt, (const char *)[data bytes], (int)[data length], 0); + int result = xmlParseChunk(self->parserCtxt, (const char *)[data bytes], (int)[data length], 0); if (result == 0) { - if (delegateQueue && [delegate respondsToSelector:@selector(xmppParserDidParseData:)]) + if (self->delegateQueue && [self->delegate respondsToSelector:@selector(xmppParserDidParseData:)]) { - __strong id theDelegate = delegate; + __strong id theDelegate = self->delegate; - dispatch_async(delegateQueue, ^{ @autoreleasepool { + dispatch_async(self->delegateQueue, ^{ @autoreleasepool { [theDelegate xmppParserDidParseData:self]; }}); @@ -828,11 +828,11 @@ - (void)parseData:(NSData *)data } else { - if (delegateQueue && [delegate respondsToSelector:@selector(xmppParser:didFail:)]) + if (self->delegateQueue && [self->delegate respondsToSelector:@selector(xmppParser:didFail:)]) { NSError *error; - xmlError *xmlErr = xmlCtxtGetLastError(parserCtxt); + xmlError *xmlErr = xmlCtxtGetLastError(self->parserCtxt); if (xmlErr->message) { @@ -846,9 +846,9 @@ - (void)parseData:(NSData *)data error = [NSError errorWithDomain:@"libxmlErrorDomain" code:xmlErr->code userInfo:nil]; } - __strong id theDelegate = delegate; + __strong id theDelegate = self->delegate; - dispatch_async(delegateQueue, ^{ @autoreleasepool { + dispatch_async(self->delegateQueue, ^{ @autoreleasepool { [theDelegate xmppParser:self didFail:error]; }}); diff --git a/Core/XMPPStream.m b/Core/XMPPStream.m index 7dd58672c4..6d11695ade 100644 --- a/Core/XMPPStream.m +++ b/Core/XMPPStream.m @@ -289,7 +289,7 @@ - (XMPPStreamState)state __block XMPPStreamState result = STATE_XMPP_DISCONNECTED; dispatch_block_t block = ^{ - result = state; + result = self->state; }; if (dispatch_get_specific(xmppQueueTag)) @@ -311,7 +311,7 @@ - (NSString *)hostName __block NSString *result; dispatch_sync(xmppQueue, ^{ - result = hostName; + result = self->hostName; }); return result; @@ -332,7 +332,7 @@ - (void)setHostName:(NSString *)newHostName NSString *newHostNameCopy = [newHostName copy]; dispatch_async(xmppQueue, ^{ - hostName = newHostNameCopy; + self->hostName = newHostNameCopy; }); } @@ -349,7 +349,7 @@ - (UInt16)hostPort __block UInt16 result; dispatch_sync(xmppQueue, ^{ - result = hostPort; + result = self->hostPort; }); return result; @@ -359,7 +359,7 @@ - (UInt16)hostPort - (void)setHostPort:(UInt16)newHostPort { dispatch_block_t block = ^{ - hostPort = newHostPort; + self->hostPort = newHostPort; }; if (dispatch_get_specific(xmppQueueTag)) @@ -373,7 +373,7 @@ - (XMPPStreamStartTLSPolicy)startTLSPolicy __block XMPPStreamStartTLSPolicy result; dispatch_block_t block = ^{ - result = startTLSPolicy; + result = self->startTLSPolicy; }; if (dispatch_get_specific(xmppQueueTag)) @@ -387,7 +387,7 @@ - (XMPPStreamStartTLSPolicy)startTLSPolicy - (void)setStartTLSPolicy:(XMPPStreamStartTLSPolicy)flag { dispatch_block_t block = ^{ - startTLSPolicy = flag; + self->startTLSPolicy = flag; }; if (dispatch_get_specific(xmppQueueTag)) @@ -398,7 +398,7 @@ - (void)setStartTLSPolicy:(XMPPStreamStartTLSPolicy)flag - (void) setPreferIPv6:(BOOL)_preferIPv6 { dispatch_block_t block = ^{ - preferIPv6 = _preferIPv6; + self->preferIPv6 = _preferIPv6; }; if (dispatch_get_specific(xmppQueueTag)) @@ -410,7 +410,7 @@ - (void) setPreferIPv6:(BOOL)_preferIPv6 { - (BOOL) preferIPv6 { __block BOOL result; dispatch_block_t block = ^{ - result = preferIPv6; + result = self->preferIPv6; }; if (dispatch_get_specific(xmppQueueTag)) @@ -426,10 +426,10 @@ - (XMPPJID *)myJID dispatch_block_t block = ^{ - if (myJID_setByServer) - result = myJID_setByServer; + if (self->myJID_setByServer) + result = self->myJID_setByServer; else - result = myJID_setByClient; + result = self->myJID_setByClient; }; if (dispatch_get_specific(xmppQueueTag)) @@ -446,15 +446,15 @@ - (void)setMyJID_setByClient:(XMPPJID *)newMyJID dispatch_block_t block = ^{ - if (![myJID_setByClient isEqualToJID:newMyJID]) + if (![self->myJID_setByClient isEqualToJID:newMyJID]) { - myJID_setByClient = newMyJID; + self->myJID_setByClient = newMyJID; - if (myJID_setByServer == nil) + if (self->myJID_setByServer == nil) { [[NSNotificationCenter defaultCenter] postNotificationName:XMPPStreamDidChangeMyJIDNotification object:self]; - [multicastDelegate xmppStreamDidChangeMyJID:self]; + [self->multicastDelegate xmppStreamDidChangeMyJID:self]; } } }; @@ -471,21 +471,21 @@ - (void)setMyJID_setByServer:(XMPPJID *)newMyJID dispatch_block_t block = ^{ - if (![myJID_setByServer isEqualToJID:newMyJID]) + if (![self->myJID_setByServer isEqualToJID:newMyJID]) { XMPPJID *oldMyJID; - if (myJID_setByServer) - oldMyJID = myJID_setByServer; + if (self->myJID_setByServer) + oldMyJID = self->myJID_setByServer; else - oldMyJID = myJID_setByClient; + oldMyJID = self->myJID_setByClient; - myJID_setByServer = newMyJID; + self->myJID_setByServer = newMyJID; if (![oldMyJID isEqualToJID:newMyJID]) { [[NSNotificationCenter defaultCenter] postNotificationName:XMPPStreamDidChangeMyJIDNotification object:self]; - [multicastDelegate xmppStreamDidChangeMyJID:self]; + [self->multicastDelegate xmppStreamDidChangeMyJID:self]; } } }; @@ -512,7 +512,7 @@ - (XMPPJID *)remoteJID __block XMPPJID *result; dispatch_sync(xmppQueue, ^{ - result = remoteJID; + result = self->remoteJID; }); return result; @@ -530,7 +530,7 @@ - (XMPPPresence *)myPresence __block XMPPPresence *result; dispatch_sync(xmppQueue, ^{ - result = myPresence; + result = self->myPresence; }); return result; @@ -542,7 +542,7 @@ - (NSTimeInterval)keepAliveInterval __block NSTimeInterval result = 0.0; dispatch_block_t block = ^{ - result = keepAliveInterval; + result = self->keepAliveInterval; }; if (dispatch_get_specific(xmppQueueTag)) @@ -557,12 +557,12 @@ - (void)setKeepAliveInterval:(NSTimeInterval)interval { dispatch_block_t block = ^{ - if (keepAliveInterval != interval) + if (self->keepAliveInterval != interval) { if (interval <= 0.0) - keepAliveInterval = interval; + self->keepAliveInterval = interval; else - keepAliveInterval = MAX(interval, MIN_KEEPALIVE_INTERVAL); + self->keepAliveInterval = MAX(interval, MIN_KEEPALIVE_INTERVAL); [self setupKeepAliveTimer]; } @@ -580,7 +580,7 @@ - (char)keepAliveWhitespaceCharacter dispatch_block_t block = ^{ - NSString *keepAliveString = [[NSString alloc] initWithData:keepAliveData encoding:NSUTF8StringEncoding]; + NSString *keepAliveString = [[NSString alloc] initWithData:self->keepAliveData encoding:NSUTF8StringEncoding]; if ([keepAliveString length] > 0) { keepAliveChar = (char)[keepAliveString characterAtIndex:0]; @@ -601,7 +601,7 @@ - (void)setKeepAliveWhitespaceCharacter:(char)keepAliveChar if (keepAliveChar == ' ' || keepAliveChar == '\n' || keepAliveChar == '\t') { - keepAliveData = [[NSString stringWithFormat:@"%c", keepAliveChar] dataUsingEncoding:NSUTF8StringEncoding]; + self->keepAliveData = [[NSString stringWithFormat:@"%c", keepAliveChar] dataUsingEncoding:NSUTF8StringEncoding]; } else { @@ -620,7 +620,7 @@ - (uint64_t)numberOfBytesSent __block uint64_t result = 0; dispatch_block_t block = ^{ - result = numberOfBytesSent; + result = self->numberOfBytesSent; }; if (dispatch_get_specific(xmppQueueTag)) @@ -636,7 +636,7 @@ - (uint64_t)numberOfBytesReceived __block uint64_t result = 0; dispatch_block_t block = ^{ - result = numberOfBytesReceived; + result = self->numberOfBytesReceived; }; if (dispatch_get_specific(xmppQueueTag)) @@ -653,8 +653,8 @@ - (void)getNumberOfBytesSent:(uint64_t *)bytesSentPtr numberOfBytesReceived:(uin __block uint64_t bytesReceived = 0; dispatch_block_t block = ^{ - bytesSent = numberOfBytesSent; - bytesReceived = numberOfBytesReceived; + bytesSent = self->numberOfBytesSent; + bytesReceived = self->numberOfBytesReceived; }; if (dispatch_get_specific(xmppQueueTag)) @@ -671,7 +671,7 @@ - (BOOL)resetByteCountPerConnection __block BOOL result = NO; dispatch_block_t block = ^{ - result = (config & kResetByteCountPerConnection) ? YES : NO; + result = (self->config & kResetByteCountPerConnection) ? YES : NO; }; if (dispatch_get_specific(xmppQueueTag)) @@ -686,9 +686,9 @@ - (void)setResetByteCountPerConnection:(BOOL)flag { dispatch_block_t block = ^{ if (flag) - config |= kResetByteCountPerConnection; + self->config |= kResetByteCountPerConnection; else - config &= ~kResetByteCountPerConnection; + self->config &= ~kResetByteCountPerConnection; }; if (dispatch_get_specific(xmppQueueTag)) @@ -702,7 +702,7 @@ - (BOOL)skipStartSession __block BOOL result = NO; dispatch_block_t block = ^{ - result = skipStartSession; + result = self->skipStartSession; }; if (dispatch_get_specific(xmppQueueTag)) @@ -716,7 +716,7 @@ - (BOOL)skipStartSession - (void)setSkipStartSession:(BOOL)flag { dispatch_block_t block = ^{ - skipStartSession = flag; + self->skipStartSession = flag; }; if (dispatch_get_specific(xmppQueueTag)) @@ -730,7 +730,7 @@ - (BOOL)validatesResponses __block BOOL result = NO; dispatch_block_t block = ^{ - result = validatesResponses; + result = self->validatesResponses; }; if (dispatch_get_specific(xmppQueueTag)) @@ -744,7 +744,7 @@ - (BOOL)validatesResponses - (void)setValidatesResponses:(BOOL)flag { dispatch_block_t block = ^{ - validatesResponses = flag; + self->validatesResponses = flag; }; if (dispatch_get_specific(xmppQueueTag)) @@ -760,7 +760,7 @@ - (BOOL)enableBackgroundingOnSocket __block BOOL result = NO; dispatch_block_t block = ^{ - result = (config & kEnableBackgroundingOnSocket) ? YES : NO; + result = (self->config & kEnableBackgroundingOnSocket) ? YES : NO; }; if (dispatch_get_specific(xmppQueueTag)) @@ -775,9 +775,9 @@ - (void)setEnableBackgroundingOnSocket:(BOOL)flag { dispatch_block_t block = ^{ if (flag) - config |= kEnableBackgroundingOnSocket; + self->config |= kEnableBackgroundingOnSocket; else - config &= ~kEnableBackgroundingOnSocket; + self->config &= ~kEnableBackgroundingOnSocket; }; if (dispatch_get_specific(xmppQueueTag)) @@ -797,7 +797,7 @@ - (void)addDelegate:(id)delegate delegateQueue:(dispatch_queue_t)delegateQueue // Asynchronous operation (if outside xmppQueue) dispatch_block_t block = ^{ - [multicastDelegate addDelegate:delegate delegateQueue:delegateQueue]; + [self->multicastDelegate addDelegate:delegate delegateQueue:delegateQueue]; }; if (dispatch_get_specific(xmppQueueTag)) @@ -811,7 +811,7 @@ - (void)removeDelegate:(id)delegate delegateQueue:(dispatch_queue_t)delegateQueu // Synchronous operation dispatch_block_t block = ^{ - [multicastDelegate removeDelegate:delegate delegateQueue:delegateQueue]; + [self->multicastDelegate removeDelegate:delegate delegateQueue:delegateQueue]; }; if (dispatch_get_specific(xmppQueueTag)) @@ -825,7 +825,7 @@ - (void)removeDelegate:(id)delegate // Synchronous operation dispatch_block_t block = ^{ - [multicastDelegate removeDelegate:delegate]; + [self->multicastDelegate removeDelegate:delegate]; }; if (dispatch_get_specific(xmppQueueTag)) @@ -849,7 +849,7 @@ - (BOOL)isP2P __block BOOL result; dispatch_sync(xmppQueue, ^{ - result = (config & kP2PMode) ? YES : NO; + result = (self->config & kP2PMode) ? YES : NO; }); return result; @@ -867,7 +867,7 @@ - (BOOL)isP2PInitiator __block BOOL result; dispatch_sync(xmppQueue, ^{ - result = ((config & kP2PMode) && (flags & kP2PInitiator)); + result = ((self->config & kP2PMode) && (self->flags & kP2PInitiator)); }); return result; @@ -885,7 +885,7 @@ - (BOOL)isP2PRecipient __block BOOL result; dispatch_sync(xmppQueue, ^{ - result = ((config & kP2PMode) && !(flags & kP2PInitiator)); + result = ((self->config & kP2PMode) && !(self->flags & kP2PInitiator)); }); return result; @@ -922,7 +922,7 @@ - (BOOL)isDisconnected __block BOOL result = NO; dispatch_block_t block = ^{ - result = (state == STATE_XMPP_DISCONNECTED); + result = (self->state == STATE_XMPP_DISCONNECTED); }; if (dispatch_get_specific(xmppQueueTag)) @@ -944,7 +944,7 @@ - (BOOL)isConnecting __block BOOL result = NO; dispatch_block_t block = ^{ @autoreleasepool { - result = (state == STATE_XMPP_CONNECTING); + result = (self->state == STATE_XMPP_CONNECTING); }}; if (dispatch_get_specific(xmppQueueTag)) @@ -963,7 +963,7 @@ - (BOOL)isConnected __block BOOL result = NO; dispatch_block_t block = ^{ - result = (state == STATE_XMPP_CONNECTED); + result = (self->state == STATE_XMPP_CONNECTED); }; if (dispatch_get_specific(xmppQueueTag)) @@ -1088,7 +1088,7 @@ - (BOOL)connectWithTimeout:(NSTimeInterval)timeout error:(NSError **)errPtr dispatch_block_t block = ^{ @autoreleasepool { - if (state != STATE_XMPP_DISCONNECTED) + if (self->state != STATE_XMPP_DISCONNECTED) { NSString *errMsg = @"Attempting to connect while already connected or connecting."; NSDictionary *info = @{NSLocalizedDescriptionKey : errMsg}; @@ -1110,7 +1110,7 @@ - (BOOL)connectWithTimeout:(NSTimeInterval)timeout error:(NSError **)errPtr return_from_block; } - if (myJID_setByClient == nil) + if (self->myJID_setByClient == nil) { // Note: If you wish to use anonymous authentication, you should still set myJID prior to calling connect. // You can simply set it to something like "anonymous@", where "" is the proper domain. @@ -1136,22 +1136,22 @@ - (BOOL)connectWithTimeout:(NSTimeInterval)timeout error:(NSError **)errPtr } // Notify delegates - [multicastDelegate xmppStreamWillConnect:self]; + [self->multicastDelegate xmppStreamWillConnect:self]; - if ([hostName length] == 0) + if ([self->hostName length] == 0) { // Resolve the hostName via myJID SRV resolution - state = STATE_XMPP_RESOLVING_SRV; + self->state = STATE_XMPP_RESOLVING_SRV; - srvResolver = [[XMPPSRVResolver alloc] initWithDelegate:self delegateQueue:xmppQueue resolverQueue:NULL]; + self->srvResolver = [[XMPPSRVResolver alloc] initWithDelegate:self delegateQueue:self->xmppQueue resolverQueue:NULL]; - srvResults = nil; - srvResultsIndex = 0; + self->srvResults = nil; + self->srvResultsIndex = 0; - NSString *srvName = [XMPPSRVResolver srvNameFromXMPPDomain:[myJID_setByClient domain]]; + NSString *srvName = [XMPPSRVResolver srvNameFromXMPPDomain:[self->myJID_setByClient domain]]; - [srvResolver startWithSRVName:srvName timeout:TIMEOUT_SRV_RESOLUTION]; + [self->srvResolver startWithSRVName:srvName timeout:TIMEOUT_SRV_RESOLUTION]; result = YES; } @@ -1159,15 +1159,15 @@ - (BOOL)connectWithTimeout:(NSTimeInterval)timeout error:(NSError **)errPtr { // Open TCP connection to the configured hostName. - state = STATE_XMPP_CONNECTING; + self->state = STATE_XMPP_CONNECTING; NSError *connectErr = nil; - result = [self connectToHost:hostName onPort:hostPort withTimeout:XMPPStreamTimeoutNone error:&connectErr]; + result = [self connectToHost:self->hostName onPort:self->hostPort withTimeout:XMPPStreamTimeoutNone error:&connectErr]; if (!result) { err = connectErr; - state = STATE_XMPP_DISCONNECTED; + self->state = STATE_XMPP_DISCONNECTED; } } @@ -1245,7 +1245,7 @@ - (BOOL)connectTo:(XMPPJID *)jid withAddress:(NSData *)remoteAddr withTimeout:(N dispatch_block_t block = ^{ @autoreleasepool { - if (state != STATE_XMPP_DISCONNECTED) + if (self->state != STATE_XMPP_DISCONNECTED) { NSString *errMsg = @"Attempting to connect while already connected or connecting."; NSDictionary *info = @{NSLocalizedDescriptionKey : errMsg}; @@ -1268,34 +1268,34 @@ - (BOOL)connectTo:(XMPPJID *)jid withAddress:(NSData *)remoteAddr withTimeout:(N } // Turn on P2P initiator flag - flags |= kP2PInitiator; + self->flags |= kP2PInitiator; // Store remoteJID - remoteJID = [jid copy]; + self->remoteJID = [jid copy]; - NSAssert((asyncSocket == nil), @"Forgot to release the previous asyncSocket instance."); + NSAssert((self->asyncSocket == nil), @"Forgot to release the previous asyncSocket instance."); // Notify delegates - [multicastDelegate xmppStreamWillConnect:self]; + [self->multicastDelegate xmppStreamWillConnect:self]; // Update state - state = STATE_XMPP_CONNECTING; + self->state = STATE_XMPP_CONNECTING; // Initailize socket - asyncSocket = [self newSocket]; + self->asyncSocket = [self newSocket]; NSError *connectErr = nil; - result = [asyncSocket connectToAddress:remoteAddr error:&connectErr]; + result = [self->asyncSocket connectToAddress:remoteAddr error:&connectErr]; if (result == NO) { err = connectErr; - state = STATE_XMPP_DISCONNECTED; + self->state = STATE_XMPP_DISCONNECTED; } else if ([self resetByteCountPerConnection]) { - numberOfBytesSent = 0; - numberOfBytesReceived = 0; + self->numberOfBytesSent = 0; + self->numberOfBytesReceived = 0; } if(result) @@ -1331,7 +1331,7 @@ - (BOOL)connectP2PWithSocket:(GCDAsyncSocket *)acceptedSocket error:(NSError **) dispatch_block_t block = ^{ @autoreleasepool { - if (state != STATE_XMPP_DISCONNECTED) + if (self->state != STATE_XMPP_DISCONNECTED) { NSString *errMsg = @"Attempting to connect while already connected or connecting."; NSDictionary *info = @{NSLocalizedDescriptionKey : errMsg}; @@ -1365,24 +1365,24 @@ - (BOOL)connectP2PWithSocket:(GCDAsyncSocket *)acceptedSocket error:(NSError **) } // Turn off P2P initiator flag - flags &= ~kP2PInitiator; + self->flags &= ~kP2PInitiator; - NSAssert((asyncSocket == nil), @"Forgot to release the previous asyncSocket instance."); + NSAssert((self->asyncSocket == nil), @"Forgot to release the previous asyncSocket instance."); // Store and configure socket - asyncSocket = acceptedSocket; - [asyncSocket setDelegate:self delegateQueue:xmppQueue]; + self->asyncSocket = acceptedSocket; + [self->asyncSocket setDelegate:self delegateQueue:self->xmppQueue]; // Notify delegates - [multicastDelegate xmppStream:self socketDidConnect:asyncSocket]; + [self->multicastDelegate xmppStream:self socketDidConnect:self->asyncSocket]; // Update state - state = STATE_XMPP_CONNECTING; + self->state = STATE_XMPP_CONNECTING; if ([self resetByteCountPerConnection]) { - numberOfBytesSent = 0; - numberOfBytesReceived = 0; + self->numberOfBytesSent = 0; + self->numberOfBytesReceived = 0; } // Start the XML stream @@ -1412,24 +1412,24 @@ - (void)abortConnecting [self endConnectTimeout]; - if (state != STATE_XMPP_DISCONNECTED && state != STATE_XMPP_CONNECTED) - { - [multicastDelegate xmppStreamWasToldToAbortConnect:self]; - - if (state == STATE_XMPP_RESOLVING_SRV) - { - [srvResolver stop]; - srvResolver = nil; - - state = STATE_XMPP_DISCONNECTED; - } - else - { - [asyncSocket disconnect]; - - // Everthing will be handled in socketDidDisconnect:withError: - } - } + if (self->state != STATE_XMPP_DISCONNECTED && self->state != STATE_XMPP_CONNECTED) + { + [self->multicastDelegate xmppStreamWasToldToAbortConnect:self]; + + if (self->state == STATE_XMPP_RESOLVING_SRV) + { + [self->srvResolver stop]; + self->srvResolver = nil; + + self->state = STATE_XMPP_DISCONNECTED; + } + else + { + [self->asyncSocket disconnect]; + + // Everthing will be handled in socketDidDisconnect:withError: + } + } }}; if (dispatch_get_specific(xmppQueueTag)) @@ -1447,22 +1447,22 @@ - (void)disconnect dispatch_block_t block = ^{ @autoreleasepool { - if (state != STATE_XMPP_DISCONNECTED) + if (self->state != STATE_XMPP_DISCONNECTED) { - [multicastDelegate xmppStreamWasToldToDisconnect:self]; + [self->multicastDelegate xmppStreamWasToldToDisconnect:self]; - if (state == STATE_XMPP_RESOLVING_SRV) + if (self->state == STATE_XMPP_RESOLVING_SRV) { - [srvResolver stop]; - srvResolver = nil; + [self->srvResolver stop]; + self->srvResolver = nil; - state = STATE_XMPP_DISCONNECTED; + self->state = STATE_XMPP_DISCONNECTED; - [multicastDelegate xmppStreamDidDisconnect:self withError:nil]; + [self->multicastDelegate xmppStreamDidDisconnect:self withError:nil]; } else { - [asyncSocket disconnect]; + [self->asyncSocket disconnect]; // Everthing will be handled in socketDidDisconnect:withError: } @@ -1481,18 +1481,18 @@ - (void)disconnectAfterSending dispatch_block_t block = ^{ @autoreleasepool { - if (state != STATE_XMPP_DISCONNECTED) + if (self->state != STATE_XMPP_DISCONNECTED) { - [multicastDelegate xmppStreamWasToldToDisconnect:self]; + [self->multicastDelegate xmppStreamWasToldToDisconnect:self]; - if (state == STATE_XMPP_RESOLVING_SRV) + if (self->state == STATE_XMPP_RESOLVING_SRV) { - [srvResolver stop]; - srvResolver = nil; + [self->srvResolver stop]; + self->srvResolver = nil; - state = STATE_XMPP_DISCONNECTED; + self->state = STATE_XMPP_DISCONNECTED; - [multicastDelegate xmppStreamDidDisconnect:self withError:nil]; + [self->multicastDelegate xmppStreamDidDisconnect:self withError:nil]; } else { @@ -1500,10 +1500,10 @@ - (void)disconnectAfterSending NSData *termData = [termStr dataUsingEncoding:NSUTF8StringEncoding]; XMPPLogSend(@"SEND: %@", termStr); - numberOfBytesSent += [termData length]; + self->numberOfBytesSent += [termData length]; - [asyncSocket writeData:termData withTimeout:TIMEOUT_XMPP_WRITE tag:TAG_XMPP_WRITE_STOP]; - [asyncSocket disconnectAfterWriting]; + [self->asyncSocket writeData:termData withTimeout:TIMEOUT_XMPP_WRITE tag:TAG_XMPP_WRITE_STOP]; + [self->asyncSocket disconnectAfterWriting]; // Everthing will be handled in socketDidDisconnect:withError: } @@ -1535,7 +1535,7 @@ - (BOOL)isSecure __block BOOL result; dispatch_sync(xmppQueue, ^{ - result = (flags & kIsSecure) ? YES : NO; + result = (self->flags & kIsSecure) ? YES : NO; }); return result; @@ -1546,9 +1546,9 @@ - (void)setIsSecure:(BOOL)flag { dispatch_block_t block = ^{ if(flag) - flags |= kIsSecure; + self->flags |= kIsSecure; else - flags &= ~kIsSecure; + self->flags &= ~kIsSecure; }; if (dispatch_get_specific(xmppQueueTag)) @@ -1565,9 +1565,9 @@ - (BOOL)supportsStartTLS // The root element can be properly queried for authentication mechanisms anytime after the // stream:features are received, and TLS has been setup (if required) - if (state >= STATE_XMPP_POST_NEGOTIATION) + if (self->state >= STATE_XMPP_POST_NEGOTIATION) { - NSXMLElement *features = [rootElement elementForName:@"stream:features"]; + NSXMLElement *features = [self->rootElement elementForName:@"stream:features"]; NSXMLElement *starttls = [features elementForName:@"starttls" xmlns:@"urn:ietf:params:xml:ns:xmpp-tls"]; result = (starttls != nil); @@ -1609,7 +1609,7 @@ - (BOOL)secureConnection:(NSError **)errPtr dispatch_block_t block = ^{ @autoreleasepool { - if (state != STATE_XMPP_CONNECTED) + if (self->state != STATE_XMPP_CONNECTED) { NSString *errMsg = @"Please wait until the stream is connected."; NSDictionary *info = @{NSLocalizedDescriptionKey : errMsg}; @@ -1643,7 +1643,7 @@ - (BOOL)secureConnection:(NSError **)errPtr } // Update state - state = STATE_XMPP_STARTTLS_1; + self->state = STATE_XMPP_STARTTLS_1; // Send the startTLS XML request [self sendStartTLSRequest]; @@ -1681,9 +1681,9 @@ - (BOOL)supportsInBandRegistration // The root element can be properly queried for authentication mechanisms anytime after the // stream:features are received, and TLS has been setup (if required) - if (state >= STATE_XMPP_POST_NEGOTIATION) + if (self->state >= STATE_XMPP_POST_NEGOTIATION) { - NSXMLElement *features = [rootElement elementForName:@"stream:features"]; + NSXMLElement *features = [self->rootElement elementForName:@"stream:features"]; NSXMLElement *reg = [features elementForName:@"register" xmlns:@"http://jabber.org/features/iq-register"]; result = (reg != nil); @@ -1713,7 +1713,7 @@ - (BOOL)registerWithElements:(NSArray *)elements error:(NSError **)errPtr dispatch_block_t block = ^{ @autoreleasepool { - if (state != STATE_XMPP_CONNECTED) + if (self->state != STATE_XMPP_CONNECTED) { NSString *errMsg = @"Please wait until the stream is connected."; NSDictionary *info = @{NSLocalizedDescriptionKey : errMsg}; @@ -1749,14 +1749,14 @@ - (BOOL)registerWithElements:(NSArray *)elements error:(NSError **)errPtr NSData *outgoingData = [outgoingStr dataUsingEncoding:NSUTF8StringEncoding]; XMPPLogSend(@"SEND: %@", outgoingStr); - numberOfBytesSent += [outgoingData length]; + self->numberOfBytesSent += [outgoingData length]; - [asyncSocket writeData:outgoingData + [self->asyncSocket writeData:outgoingData withTimeout:TIMEOUT_XMPP_WRITE tag:TAG_XMPP_WRITE_STREAM]; // Update state - state = STATE_XMPP_REGISTERING; + self->state = STATE_XMPP_REGISTERING; }}; @@ -1787,7 +1787,7 @@ - (BOOL)registerWithPassword:(NSString *)password error:(NSError * __autoreleasi dispatch_block_t block = ^{ @autoreleasepool { - if (myJID_setByClient == nil) + if (self->myJID_setByClient == nil) { NSString *errMsg = @"You must set myJID before calling registerWithPassword:error:."; NSDictionary *info = @{NSLocalizedDescriptionKey : errMsg}; @@ -1798,7 +1798,7 @@ - (BOOL)registerWithPassword:(NSString *)password error:(NSError * __autoreleasi return_from_block; } - NSString *username = [myJID_setByClient user]; + NSString *username = [self->myJID_setByClient user]; NSMutableArray *elements = [NSMutableArray array]; [elements addObject:[NSXMLElement elementWithName:@"username" stringValue:username]]; @@ -1832,9 +1832,9 @@ - (NSArray *)supportedAuthenticationMechanisms // The root element can be properly queried for authentication mechanisms anytime after the // stream:features are received, and TLS has been setup (if required). - if (state >= STATE_XMPP_POST_NEGOTIATION) + if (self->state >= STATE_XMPP_POST_NEGOTIATION) { - NSXMLElement *features = [rootElement elementForName:@"stream:features"]; + NSXMLElement *features = [self->rootElement elementForName:@"stream:features"]; NSXMLElement *mech = [features elementForName:@"mechanisms" xmlns:@"urn:ietf:params:xml:ns:xmpp-sasl"]; NSArray *mechanisms = [mech elementsForName:@"mechanism"]; @@ -1869,9 +1869,9 @@ - (BOOL)supportsAuthenticationMechanism:(NSString *)mechanismType // The root element can be properly queried for authentication mechanisms anytime after the // stream:features are received, and TLS has been setup (if required). - if (state >= STATE_XMPP_POST_NEGOTIATION) + if (self->state >= STATE_XMPP_POST_NEGOTIATION) { - NSXMLElement *features = [rootElement elementForName:@"stream:features"]; + NSXMLElement *features = [self->rootElement elementForName:@"stream:features"]; NSXMLElement *mech = [features elementForName:@"mechanisms" xmlns:@"urn:ietf:params:xml:ns:xmpp-sasl"]; NSArray *mechanisms = [mech elementsForName:@"mechanism"]; @@ -1904,7 +1904,7 @@ - (BOOL)authenticate:(id )inAuth error:(NSError **)errPt dispatch_block_t block = ^{ @autoreleasepool { - if (state != STATE_XMPP_CONNECTED) + if (self->state != STATE_XMPP_CONNECTED) { NSString *errMsg = @"Please wait until the stream is connected."; NSDictionary *info = @{NSLocalizedDescriptionKey : errMsg}; @@ -1915,7 +1915,7 @@ - (BOOL)authenticate:(id )inAuth error:(NSError **)errPt return_from_block; } - if (myJID_setByClient == nil) + if (self->myJID_setByClient == nil) { NSString *errMsg = @"You must set myJID before calling authenticate:error:."; NSDictionary *info = @{NSLocalizedDescriptionKey : errMsg}; @@ -1929,18 +1929,18 @@ - (BOOL)authenticate:(id )inAuth error:(NSError **)errPt // Change state. // We do this now because when we invoke the start method below, // it may in turn invoke our sendAuthElement method, which expects us to be in STATE_XMPP_AUTH. - state = STATE_XMPP_AUTH; + self->state = STATE_XMPP_AUTH; if ([inAuth start:&err]) { - auth = inAuth; + self->auth = inAuth; result = YES; } else { // Unable to start authentication for some reason. // Revert back to connected state. - state = STATE_XMPP_CONNECTED; + self->state = STATE_XMPP_CONNECTED; } }}; @@ -1976,7 +1976,7 @@ - (BOOL)authenticateWithPassword:(NSString *)inPassword error:(NSError **)errPtr dispatch_block_t block = ^{ @autoreleasepool { - if (state != STATE_XMPP_CONNECTED) + if (self->state != STATE_XMPP_CONNECTED) { NSString *errMsg = @"Please wait until the stream is connected."; NSDictionary *info = @{NSLocalizedDescriptionKey : errMsg}; @@ -1987,7 +1987,7 @@ - (BOOL)authenticateWithPassword:(NSString *)inPassword error:(NSError **)errPtr return_from_block; } - if (myJID_setByClient == nil) + if (self->myJID_setByClient == nil) { NSString *errMsg = @"You must set myJID before calling authenticate:error:."; NSDictionary *info = @{NSLocalizedDescriptionKey : errMsg}; @@ -2057,7 +2057,7 @@ - (BOOL)isAuthenticating __block BOOL result = NO; dispatch_block_t block = ^{ @autoreleasepool { - result = (state == STATE_XMPP_AUTH); + result = (self->state == STATE_XMPP_AUTH); }}; if (dispatch_get_specific(xmppQueueTag)) @@ -2073,7 +2073,7 @@ - (BOOL)isAuthenticated __block BOOL result = NO; dispatch_block_t block = ^{ - result = (flags & kIsAuthenticated) ? YES : NO; + result = (self->flags & kIsAuthenticated) ? YES : NO; }; if (dispatch_get_specific(xmppQueueTag)) @@ -2089,13 +2089,13 @@ - (void)setIsAuthenticated:(BOOL)flag dispatch_block_t block = ^{ if(flag) { - flags |= kIsAuthenticated; - authenticationDate = [NSDate date]; + self->flags |= kIsAuthenticated; + self->authenticationDate = [NSDate date]; } else { - flags &= ~kIsAuthenticated; - authenticationDate = nil; + self->flags &= ~kIsAuthenticated; + self->authenticationDate = nil; } }; @@ -2110,9 +2110,9 @@ - (NSDate *)authenticationDate __block NSDate *result = nil; dispatch_block_t block = ^{ - if(flags & kIsAuthenticated) + if(self->flags & kIsAuthenticated) { - result = authenticationDate; + result = self->authenticationDate; } }; @@ -2137,9 +2137,9 @@ - (NSArray *)supportedCompressionMethods // The root element can be properly queried for compression methods anytime after the // stream:features are received, and TLS has been setup (if required). - if (state >= STATE_XMPP_POST_NEGOTIATION) + if (self->state >= STATE_XMPP_POST_NEGOTIATION) { - NSXMLElement *features = [rootElement elementForName:@"stream:features"]; + NSXMLElement *features = [self->rootElement elementForName:@"stream:features"]; NSXMLElement *compression = [features elementForName:@"compression" xmlns:@"http://jabber.org/features/compress"]; NSArray *methods = [compression elementsForName:@"method"]; @@ -2174,9 +2174,9 @@ - (BOOL)supportsCompressionMethod:(NSString *)compressionMethod // The root element can be properly queried for compression methods anytime after the // stream:features are received, and TLS has been setup (if required). - if (state >= STATE_XMPP_POST_NEGOTIATION) + if (self->state >= STATE_XMPP_POST_NEGOTIATION) { - NSXMLElement *features = [rootElement elementForName:@"stream:features"]; + NSXMLElement *features = [self->rootElement elementForName:@"stream:features"]; NSXMLElement *compression = [features elementForName:@"compression" xmlns:@"http://jabber.org/features/compress"]; NSArray *methods = [compression elementsForName:@"method"]; @@ -2223,7 +2223,7 @@ - (NSXMLElement *)rootElement __block NSXMLElement *result = nil; dispatch_sync(xmppQueue, ^{ - result = [rootElement copy]; + result = [self->rootElement copy]; }); return result; @@ -2246,7 +2246,7 @@ - (float)serverXmppStreamVersionNumber __block float result; dispatch_sync(xmppQueue, ^{ - result = [rootElement attributeFloatValueForName:@"version" withDefaultValue:0.0F]; + result = [self->rootElement attributeFloatValueForName:@"version" withDefaultValue:0.0F]; }); return result; @@ -2312,9 +2312,9 @@ - (void)sendIQ:(XMPPIQ *)iq withTag:(long)tag if (modifiedIQ) { - dispatch_async(xmppQueue, ^{ @autoreleasepool { + dispatch_async(self->xmppQueue, ^{ @autoreleasepool { - if (state == STATE_XMPP_CONNECTED) { + if (self->state == STATE_XMPP_CONNECTED) { [self continueSendIQ:modifiedIQ withTag:tag]; } else { [self failToSendIQ:modifiedIQ]; @@ -2384,9 +2384,9 @@ - (void)sendMessage:(XMPPMessage *)message withTag:(long)tag if (modifiedMessage) { - dispatch_async(xmppQueue, ^{ @autoreleasepool { + dispatch_async(self->xmppQueue, ^{ @autoreleasepool { - if (state == STATE_XMPP_CONNECTED) { + if (self->state == STATE_XMPP_CONNECTED) { [self continueSendMessage:modifiedMessage withTag:tag]; } else { @@ -2457,9 +2457,9 @@ - (void)sendPresence:(XMPPPresence *)presence withTag:(long)tag if (modifiedPresence) { - dispatch_async(xmppQueue, ^{ @autoreleasepool { + dispatch_async(self->xmppQueue, ^{ @autoreleasepool { - if (state == STATE_XMPP_CONNECTED) { + if (self->state == STATE_XMPP_CONNECTED) { [self continueSendPresence:modifiedPresence withTag:tag]; } else { [self failToSendPresence:modifiedPresence]; @@ -2614,7 +2614,7 @@ - (void)sendElement:(NSXMLElement *)element dispatch_block_t block = ^{ @autoreleasepool { - if (state == STATE_XMPP_CONNECTED) + if (self->state == STATE_XMPP_CONNECTED) { [self sendElement:element withTag:TAG_XMPP_WRITE_STREAM]; } @@ -2651,10 +2651,10 @@ - (void)sendElement:(NSXMLElement *)element andGetReceipt:(XMPPElementReceipt ** dispatch_block_t block = ^{ @autoreleasepool { - if (state == STATE_XMPP_CONNECTED) + if (self->state == STATE_XMPP_CONNECTED) { receipt = [[XMPPElementReceipt alloc] init]; - [receipts addObject:receipt]; + [self->receipts addObject:receipt]; [self sendElement:element withTag:TAG_XMPP_WRITE_RECEIPT]; } @@ -2749,9 +2749,9 @@ - (void)resendMyPresence { dispatch_block_t block = ^{ @autoreleasepool { - if (myPresence && [[myPresence type] isEqualToString:@"available"]) + if (self->myPresence && [[self->myPresence type] isEqualToString:@"available"]) { - [self sendElement:myPresence]; + [self sendElement:self->myPresence]; } }}; @@ -2772,17 +2772,17 @@ - (void)sendAuthElement:(NSXMLElement *)element { dispatch_block_t block = ^{ @autoreleasepool { - if (state == STATE_XMPP_AUTH) + if (self->state == STATE_XMPP_AUTH) { NSString *outgoingStr = [element compactXMLString]; NSData *outgoingData = [outgoingStr dataUsingEncoding:NSUTF8StringEncoding]; XMPPLogSend(@"SEND: %@", outgoingStr); - numberOfBytesSent += [outgoingData length]; + self->numberOfBytesSent += [outgoingData length]; - [asyncSocket writeData:outgoingData - withTimeout:TIMEOUT_XMPP_WRITE - tag:TAG_XMPP_WRITE_STREAM]; + [self->asyncSocket writeData:outgoingData + withTimeout:TIMEOUT_XMPP_WRITE + tag:TAG_XMPP_WRITE_STREAM]; } else { @@ -2807,17 +2807,17 @@ - (void)sendBindElement:(NSXMLElement *)element { dispatch_block_t block = ^{ @autoreleasepool { - if (state == STATE_XMPP_BINDING) + if (self->state == STATE_XMPP_BINDING) { NSString *outgoingStr = [element compactXMLString]; NSData *outgoingData = [outgoingStr dataUsingEncoding:NSUTF8StringEncoding]; XMPPLogSend(@"SEND: %@", outgoingStr); - numberOfBytesSent += [outgoingData length]; + self->numberOfBytesSent += [outgoingData length]; - [asyncSocket writeData:outgoingData - withTimeout:TIMEOUT_XMPP_WRITE - tag:TAG_XMPP_WRITE_STREAM]; + [self->asyncSocket writeData:outgoingData + withTimeout:TIMEOUT_XMPP_WRITE + tag:TAG_XMPP_WRITE_STREAM]; } else { @@ -2851,8 +2851,8 @@ - (void)receiveIQ:(XMPPIQ *)iq // But still go through the stanzaQueue in order to guarantee in-order-delivery of all received stanzas. dispatch_async(willReceiveStanzaQueue, ^{ - dispatch_async(xmppQueue, ^{ @autoreleasepool { - if (state == STATE_XMPP_CONNECTED) { + dispatch_async(self->xmppQueue, ^{ @autoreleasepool { + if (self->state == STATE_XMPP_CONNECTED) { [self continueReceiveIQ:iq]; } }}); @@ -2891,14 +2891,14 @@ - (void)receiveIQ:(XMPPIQ *)iq }}); } - dispatch_async(xmppQueue, ^{ @autoreleasepool { + dispatch_async(self->xmppQueue, ^{ @autoreleasepool { - if (state == STATE_XMPP_CONNECTED) + if (self->state == STATE_XMPP_CONNECTED) { if (modifiedIQ) [self continueReceiveIQ:modifiedIQ]; else - [multicastDelegate xmppStreamDidFilterStanza:self]; + [self->multicastDelegate xmppStreamDidFilterStanza:self]; } }}); }}); @@ -2925,9 +2925,9 @@ - (void)receiveMessage:(XMPPMessage *)message // But still go through the stanzaQueue in order to guarantee in-order-delivery of all received stanzas. dispatch_async(willReceiveStanzaQueue, ^{ - dispatch_async(xmppQueue, ^{ @autoreleasepool { + dispatch_async(self->xmppQueue, ^{ @autoreleasepool { - if (state == STATE_XMPP_CONNECTED) { + if (self->state == STATE_XMPP_CONNECTED) { [self continueReceiveMessage:message]; } }}); @@ -2966,14 +2966,14 @@ - (void)receiveMessage:(XMPPMessage *)message }}); } - dispatch_async(xmppQueue, ^{ @autoreleasepool { + dispatch_async(self->xmppQueue, ^{ @autoreleasepool { - if (state == STATE_XMPP_CONNECTED) + if (self->state == STATE_XMPP_CONNECTED) { if (modifiedMessage) [self continueReceiveMessage:modifiedMessage]; else - [multicastDelegate xmppStreamDidFilterStanza:self]; + [self->multicastDelegate xmppStreamDidFilterStanza:self]; } }}); }}); @@ -3000,9 +3000,9 @@ - (void)receivePresence:(XMPPPresence *)presence // But still go through the stanzaQueue in order to guarantee in-order-delivery of all received stanzas. dispatch_async(willReceiveStanzaQueue, ^{ - dispatch_async(xmppQueue, ^{ @autoreleasepool { + dispatch_async(self->xmppQueue, ^{ @autoreleasepool { - if (state == STATE_XMPP_CONNECTED) { + if (self->state == STATE_XMPP_CONNECTED) { [self continueReceivePresence:presence]; } }}); @@ -3041,14 +3041,14 @@ - (void)receivePresence:(XMPPPresence *)presence }}); } - dispatch_async(xmppQueue, ^{ @autoreleasepool { + dispatch_async(self->xmppQueue, ^{ @autoreleasepool { - if (state == STATE_XMPP_CONNECTED) + if (self->state == STATE_XMPP_CONNECTED) { if (modifiedPresence) [self continueReceivePresence:presence]; else - [multicastDelegate xmppStreamDidFilterStanza:self]; + [self->multicastDelegate xmppStreamDidFilterStanza:self]; } }}); }}); @@ -3175,7 +3175,7 @@ - (void)injectElement:(NSXMLElement *)element dispatch_block_t block = ^{ @autoreleasepool { - if (state != STATE_XMPP_CONNECTED) + if (self->state != STATE_XMPP_CONNECTED) { return_from_block; } @@ -3208,13 +3208,13 @@ - (void)injectElement:(NSXMLElement *)element { [self receivePresence:[XMPPPresence presenceFromElement:element]]; } - else if ([customElementNames countForObject:elementName]) + else if ([self->customElementNames countForObject:elementName]) { - [multicastDelegate xmppStream:self didReceiveCustomElement:element]; + [self->multicastDelegate xmppStream:self didReceiveCustomElement:element]; } else { - [multicastDelegate xmppStream:self didReceiveError:element]; + [self->multicastDelegate xmppStream:self didReceiveError:element]; } } }}; @@ -3229,12 +3229,12 @@ - (void)registerCustomElementNames:(NSSet *)names { dispatch_block_t block = ^{ - if (customElementNames == nil) - customElementNames = [[NSCountedSet alloc] init]; + if (self->customElementNames == nil) + self->customElementNames = [[NSCountedSet alloc] init]; for (NSString *name in names) { - [customElementNames addObject:name]; + [self->customElementNames addObject:name]; } }; @@ -3250,7 +3250,7 @@ - (void)unregisterCustomElementNames:(NSSet *)names for (NSString *name in names) { - [customElementNames removeObject:name]; + [self->customElementNames removeObject:name]; } }; @@ -3432,7 +3432,7 @@ - (void)startTLS }}); } - dispatch_async(xmppQueue, ^{ @autoreleasepool { + dispatch_async(self->xmppQueue, ^{ @autoreleasepool { [self continueStartTLS:settings]; @@ -3729,7 +3729,7 @@ - (void)startBinding } } - dispatch_async(xmppQueue, ^{ @autoreleasepool { + dispatch_async(self->xmppQueue, ^{ @autoreleasepool { if (delegateCustomBinding) [self startCustomBinding:delegateCustomBinding]; @@ -3967,7 +3967,7 @@ - (void)handleStandardBinding:(NSXMLElement *)response } } - dispatch_async(xmppQueue, ^{ @autoreleasepool { + dispatch_async(self->xmppQueue, ^{ @autoreleasepool { [self continueHandleStandardBinding:alternativeResource]; @@ -4229,7 +4229,7 @@ - (void)socket:(GCDAsyncSocket *)sock didConnectToHost:(NSString *)host port:(UI __block BOOL result; [asyncSocket performBlock:^{ - result = [asyncSocket enableBackgroundingOnSocket]; + result = [self->asyncSocket enableBackgroundingOnSocket]; }]; if (result) @@ -4841,12 +4841,12 @@ - (void)registerModule:(XMPPModule *)module // Register module - [registeredModules addObject:module]; + [self->registeredModules addObject:module]; // Add auto delegates (if there are any) NSString *className = NSStringFromClass([module class]); - GCDMulticastDelegate *autoDelegates = autoDelegateDict[className]; + GCDMulticastDelegate *autoDelegates = self->autoDelegateDict[className]; GCDMulticastDelegateEnumerator *autoDelegatesEnumerator = [autoDelegates delegateEnumerator]; id delegate; @@ -4859,7 +4859,7 @@ - (void)registerModule:(XMPPModule *)module // Notify our own delegate(s) - [multicastDelegate xmppStream:self didRegisterModule:module]; + [self->multicastDelegate xmppStream:self didRegisterModule:module]; }}; @@ -4881,12 +4881,12 @@ - (void)unregisterModule:(XMPPModule *)module // Notify our own delegate(s) - [multicastDelegate xmppStream:self willUnregisterModule:module]; + [self->multicastDelegate xmppStream:self willUnregisterModule:module]; // Remove auto delegates (if there are any) NSString *className = NSStringFromClass([module class]); - GCDMulticastDelegate *autoDelegates = autoDelegateDict[className]; + GCDMulticastDelegate *autoDelegates = self->autoDelegateDict[className]; GCDMulticastDelegateEnumerator *autoDelegatesEnumerator = [autoDelegates delegateEnumerator]; id delegate; @@ -4904,7 +4904,7 @@ - (void)unregisterModule:(XMPPModule *)module // Unregister modules - [registeredModules removeObject:module]; + [self->registeredModules removeObject:module]; }}; @@ -4929,7 +4929,7 @@ - (void)autoAddDelegate:(id)delegate delegateQueue:(dispatch_queue_t)delegateQue // Add the delegate to all currently registered modules of the given class. - for (XMPPModule *module in registeredModules) + for (XMPPModule *module in self->registeredModules) { if ([module isKindOfClass:aClass]) { @@ -4940,12 +4940,12 @@ - (void)autoAddDelegate:(id)delegate delegateQueue:(dispatch_queue_t)delegateQue // Add the delegate to list of auto delegates for the given class. // It will be added as a delegate to future registered modules of the given class. - id delegates = autoDelegateDict[className]; + id delegates = self->autoDelegateDict[className]; if (delegates == nil) { delegates = [[GCDMulticastDelegate alloc] init]; - autoDelegateDict[className] = delegates; + self->autoDelegateDict[className] = delegates; } [delegates addDelegate:delegate delegateQueue:delegateQueue]; @@ -4974,7 +4974,7 @@ - (void)removeAutoDelegate:(id)delegate delegateQueue:(dispatch_queue_t)delegate { // Remove the delegate from all currently registered modules of ANY class. - for (XMPPModule *module in registeredModules) + for (XMPPModule *module in self->registeredModules) { [module removeDelegate:delegate delegateQueue:delegateQueue]; } @@ -4982,7 +4982,7 @@ - (void)removeAutoDelegate:(id)delegate delegateQueue:(dispatch_queue_t)delegate // Remove the delegate from list of auto delegates for all classes, // so that it will not be auto added as a delegate to future registered modules. - for (GCDMulticastDelegate *delegates in [autoDelegateDict objectEnumerator]) + for (GCDMulticastDelegate *delegates in [self->autoDelegateDict objectEnumerator]) { [delegates removeDelegate:delegate delegateQueue:delegateQueue]; } @@ -4993,7 +4993,7 @@ - (void)removeAutoDelegate:(id)delegate delegateQueue:(dispatch_queue_t)delegate // Remove the delegate from all currently registered modules of the given class. - for (XMPPModule *module in registeredModules) + for (XMPPModule *module in self->registeredModules) { if ([module isKindOfClass:aClass]) { @@ -5004,12 +5004,12 @@ - (void)removeAutoDelegate:(id)delegate delegateQueue:(dispatch_queue_t)delegate // Remove the delegate from list of auto delegates for the given class, // so that it will not be added as a delegate to future registered modules of the given class. - GCDMulticastDelegate *delegates = autoDelegateDict[className]; + GCDMulticastDelegate *delegates = self->autoDelegateDict[className]; [delegates removeDelegate:delegate delegateQueue:delegateQueue]; if ([delegates count] == 0) { - [autoDelegateDict removeObjectForKey:className]; + [self->autoDelegateDict removeObjectForKey:className]; } } @@ -5032,7 +5032,7 @@ - (void)enumerateModulesWithBlock:(void (^)(XMPPModule *module, NSUInteger idx, NSUInteger i = 0; BOOL stop = NO; - for (XMPPModule *module in registeredModules) + for (XMPPModule *module in self->registeredModules) { enumBlock(module, i, &stop); diff --git a/Extensions/BandwidthMonitor/XMPPBandwidthMonitor.m b/Extensions/BandwidthMonitor/XMPPBandwidthMonitor.m index 05a8e3bab5..0d00d5769f 100644 --- a/Extensions/BandwidthMonitor/XMPPBandwidthMonitor.m +++ b/Extensions/BandwidthMonitor/XMPPBandwidthMonitor.m @@ -30,7 +30,7 @@ - (double)outgoingBandwidth __block double result = 0.0; dispatch_block_t block = ^{ - result = smoothedAverageOutgoingBandwidth; + result = self->smoothedAverageOutgoingBandwidth; }; if (dispatch_get_specific(moduleQueueTag)) @@ -46,7 +46,7 @@ - (double)incomingBandwidth __block double result = 0.0; dispatch_block_t block = ^{ - result = smoothedAverageIncomingBandwidth; + result = self->smoothedAverageIncomingBandwidth; }; if (dispatch_get_specific(moduleQueueTag)) diff --git a/Extensions/CoreDataStorage/XMPPCoreDataStorage.m b/Extensions/CoreDataStorage/XMPPCoreDataStorage.m index 71ef5590f1..86121550db 100644 --- a/Extensions/CoreDataStorage/XMPPCoreDataStorage.m +++ b/Extensions/CoreDataStorage/XMPPCoreDataStorage.m @@ -332,7 +332,7 @@ - (NSUInteger)saveThreshold __block NSUInteger result; dispatch_sync(storageQueue, ^{ - result = saveThreshold; + result = self->saveThreshold; }); return result; @@ -342,7 +342,7 @@ - (NSUInteger)saveThreshold - (void)setSaveThreshold:(NSUInteger)newSaveThreshold { dispatch_block_t block = ^{ - saveThreshold = newSaveThreshold; + self->saveThreshold = newSaveThreshold; }; if (dispatch_get_specific(storageQueueTag)) @@ -375,13 +375,13 @@ - (XMPPJID *)myJIDForXMPPStream:(XMPPStream *)stream NSNumber *key = [NSNumber xmpp_numberWithPtr:(__bridge void *)stream]; - result = (XMPPJID *) myJidCache[key]; + result = (XMPPJID *) self->myJidCache[key]; if (!result) { result = [stream myJID]; if (result) { - myJidCache[key] = result; + self->myJidCache[key] = result; } } }}; @@ -411,7 +411,7 @@ - (void)updateJidCache:(NSNotification *)notification dispatch_block_t block = ^{ @autoreleasepool { NSNumber *key = [NSNumber xmpp_numberWithPtr:(__bridge void *)stream]; - XMPPJID *cachedJID = myJidCache[key]; + XMPPJID *cachedJID = self->myJidCache[key]; if (cachedJID) { @@ -421,13 +421,13 @@ - (void)updateJidCache:(NSNotification *)notification { if (![cachedJID isEqualToJID:newJID]) { - myJidCache[key] = newJID; + self->myJidCache[key] = newJID; [self didChangeCachedMyJID:newJID forXMPPStream:stream]; } } else { - [myJidCache removeObjectForKey:key]; + [self->myJidCache removeObjectForKey:key]; [self didChangeCachedMyJID:nil forXMPPStream:stream]; } } @@ -477,9 +477,9 @@ - (NSManagedObjectModel *)managedObjectModel dispatch_block_t block = ^{ @autoreleasepool { - if (managedObjectModel) + if (self->managedObjectModel) { - result = managedObjectModel; + result = self->managedObjectModel; return; } @@ -500,38 +500,38 @@ - (NSManagedObjectModel *)managedObjectModel NSURL *momUrl = [NSURL fileURLWithPath:momPath]; - managedObjectModel = [[[NSManagedObjectModel alloc] initWithContentsOfURL:momUrl] copy]; + self->managedObjectModel = [[[NSManagedObjectModel alloc] initWithContentsOfURL:momUrl] copy]; } else { XMPPLogWarn(@"%@: Couldn't find managedObjectModel file - %@", [self class], momName); } - if([NSAttributeDescription instancesRespondToSelector:@selector(setAllowsExternalBinaryDataStorage:)]) - { - if(autoAllowExternalBinaryDataStorage) - { - NSArray *entities = [managedObjectModel entities]; - - for(NSEntityDescription *entity in entities) - { - NSDictionary *attributesByName = [entity attributesByName]; - - [attributesByName enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { - - if([obj attributeType] == NSBinaryDataAttributeType) - { - [obj setAllowsExternalBinaryDataStorage:YES]; - } - - }]; - } - - } + if([NSAttributeDescription instancesRespondToSelector:@selector(setAllowsExternalBinaryDataStorage:)]) + { + if(self->autoAllowExternalBinaryDataStorage) + { + NSArray *entities = [self->managedObjectModel entities]; + + for(NSEntityDescription *entity in entities) + { + NSDictionary *attributesByName = [entity attributesByName]; + + [attributesByName enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + + if([obj attributeType] == NSBinaryDataAttributeType) + { + [obj setAllowsExternalBinaryDataStorage:YES]; + } + + }]; + } + + } } - result = managedObjectModel; + result = self->managedObjectModel; }}; if (dispatch_get_specific(storageQueueTag)) @@ -551,9 +551,9 @@ - (NSPersistentStoreCoordinator *)persistentStoreCoordinator dispatch_block_t block = ^{ @autoreleasepool { - if (persistentStoreCoordinator) + if (self->persistentStoreCoordinator) { - result = persistentStoreCoordinator; + result = self->persistentStoreCoordinator; return; } @@ -565,42 +565,42 @@ - (NSPersistentStoreCoordinator *)persistentStoreCoordinator XMPPLogVerbose(@"%@: Creating persistentStoreCoordinator", [self class]); - persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:mom]; + self->persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:mom]; - if (databaseFileName) + if (self->databaseFileName) { // SQLite persistent store NSString *docsPath = [self persistentStoreDirectory]; - NSString *storePath = [docsPath stringByAppendingPathComponent:databaseFileName]; + NSString *storePath = [docsPath stringByAppendingPathComponent:self->databaseFileName]; if (storePath) { // If storePath is nil, then NSURL will throw an exception - - if(autoRemovePreviousDatabaseFile) - { - if ([[NSFileManager defaultManager] fileExistsAtPath:storePath]) - { - [[NSFileManager defaultManager] removeItemAtPath:storePath error:nil]; - } - } + + if(self->autoRemovePreviousDatabaseFile) + { + if ([[NSFileManager defaultManager] fileExistsAtPath:storePath]) + { + [[NSFileManager defaultManager] removeItemAtPath:storePath error:nil]; + } + } - [self willCreatePersistentStoreWithPath:storePath options:storeOptions]; + [self willCreatePersistentStoreWithPath:storePath options:self->storeOptions]; NSError *error = nil; - BOOL didAddPersistentStore = [self addPersistentStoreWithPath:storePath options:storeOptions error:&error]; + BOOL didAddPersistentStore = [self addPersistentStoreWithPath:storePath options:self->storeOptions error:&error]; - if(autoRecreateDatabaseFile && !didAddPersistentStore) + if(self->autoRecreateDatabaseFile && !didAddPersistentStore) { [[NSFileManager defaultManager] removeItemAtPath:storePath error:NULL]; - didAddPersistentStore = [self addPersistentStoreWithPath:storePath options:storeOptions error:&error]; + didAddPersistentStore = [self addPersistentStoreWithPath:storePath options:self->storeOptions error:&error]; } if (!didAddPersistentStore) { - [self didNotAddPersistentStoreWithPath:storePath options:storeOptions error:error]; + [self didNotAddPersistentStoreWithPath:storePath options:self->storeOptions error:error]; } } else @@ -613,16 +613,16 @@ - (NSPersistentStoreCoordinator *)persistentStoreCoordinator { // In-Memory persistent store - [self willCreatePersistentStoreWithPath:nil options:storeOptions]; + [self willCreatePersistentStoreWithPath:nil options:self->storeOptions]; NSError *error = nil; - if (![self addPersistentStoreWithPath:nil options:storeOptions error:&error]) + if (![self addPersistentStoreWithPath:nil options:self->storeOptions error:&error]) { - [self didNotAddPersistentStoreWithPath:nil options:storeOptions error:error]; + [self didNotAddPersistentStoreWithPath:nil options:self->storeOptions error:error]; } } - result = persistentStoreCoordinator; + result = self->persistentStoreCoordinator; }}; @@ -746,11 +746,11 @@ - (void)managedObjectContextDidSave:(NSNotification *)notification dispatch_async(dispatch_get_main_queue(), ^{ // http://stackoverflow.com/questions/3923826/nsfetchedresultscontroller-with-predicate-ignores-changes-merged-from-different - for (NSManagedObject *object in [notification userInfo][NSUpdatedObjectsKey]) { - [[mainThreadManagedObjectContext objectWithID:[object objectID]] willAccessValueForKey:nil]; - } + for (NSManagedObject *object in [notification userInfo][NSUpdatedObjectsKey]) { + [[self->mainThreadManagedObjectContext objectWithID:[object objectID]] willAccessValueForKey:nil]; + } - [mainThreadManagedObjectContext mergeChangesFromContextDidSaveNotification:notification]; + [self->mainThreadManagedObjectContext mergeChangesFromContextDidSaveNotification:notification]; [self mainThreadManagedObjectContextDidMergeChanges]; }); } @@ -761,7 +761,7 @@ - (BOOL)autoRemovePreviousDatabaseFile __block BOOL result = NO; dispatch_block_t block = ^{ @autoreleasepool { - result = autoRemovePreviousDatabaseFile; + result = self->autoRemovePreviousDatabaseFile; }}; if (dispatch_get_specific(storageQueueTag)) @@ -775,7 +775,7 @@ - (BOOL)autoRemovePreviousDatabaseFile - (void)setAutoRemovePreviousDatabaseFile:(BOOL)flag { dispatch_block_t block = ^{ - autoRemovePreviousDatabaseFile = flag; + self->autoRemovePreviousDatabaseFile = flag; }; if (dispatch_get_specific(storageQueueTag)) @@ -789,7 +789,7 @@ - (BOOL)autoRecreateDatabaseFile __block BOOL result = NO; dispatch_block_t block = ^{ @autoreleasepool { - result = autoRecreateDatabaseFile; + result = self->autoRecreateDatabaseFile; }}; if (dispatch_get_specific(storageQueueTag)) @@ -803,7 +803,7 @@ - (BOOL)autoRecreateDatabaseFile - (void)setAutoRecreateDatabaseFile:(BOOL)flag { dispatch_block_t block = ^{ - autoRecreateDatabaseFile = flag; + self->autoRecreateDatabaseFile = flag; }; if (dispatch_get_specific(storageQueueTag)) @@ -817,7 +817,7 @@ - (BOOL)autoAllowExternalBinaryDataStorage __block BOOL result = NO; dispatch_block_t block = ^{ @autoreleasepool { - result = autoAllowExternalBinaryDataStorage; + result = self->autoAllowExternalBinaryDataStorage; }}; if (dispatch_get_specific(storageQueueTag)) @@ -831,7 +831,7 @@ - (BOOL)autoAllowExternalBinaryDataStorage - (void)setAutoAllowExternalBinaryDataStorage:(BOOL)flag { dispatch_block_t block = ^{ - autoAllowExternalBinaryDataStorage = flag; + self->autoAllowExternalBinaryDataStorage = flag; }; if (dispatch_get_specific(storageQueueTag)) @@ -945,9 +945,9 @@ - (void)executeBlock:(dispatch_block_t)block // Since this is a synchronous request, we want to return as quickly as possible. // So we delay the maybeSave operation til later. - dispatch_async(storageQueue, ^{ @autoreleasepool { + dispatch_async(self->storageQueue, ^{ @autoreleasepool { - [self maybeSave:OSAtomicDecrement32(&pendingRequests)]; + [self maybeSave:OSAtomicDecrement32(&self->pendingRequests)]; }}); }}); @@ -971,14 +971,14 @@ - (void)scheduleBlock:(dispatch_block_t)block dispatch_async(storageQueue, ^{ @autoreleasepool { block(); - [self maybeSave:OSAtomicDecrement32(&pendingRequests)]; + [self maybeSave:OSAtomicDecrement32(&self->pendingRequests)]; }}); } - (void)addWillSaveManagedObjectContextBlock:(void (^)(void))willSaveBlock { dispatch_block_t block = ^{ - [willSaveManagedObjectContextBlocks addObject:[willSaveBlock copy]]; + [self->willSaveManagedObjectContextBlocks addObject:[willSaveBlock copy]]; }; if (dispatch_get_specific(storageQueueTag)) @@ -990,7 +990,7 @@ - (void)addWillSaveManagedObjectContextBlock:(void (^)(void))willSaveBlock - (void)addDidSaveManagedObjectContextBlock:(void (^)(void))didSaveBlock { dispatch_block_t block = ^{ - [didSaveManagedObjectContextBlocks addObject:[didSaveBlock copy]]; + [self->didSaveManagedObjectContextBlocks addObject:[didSaveBlock copy]]; }; if (dispatch_get_specific(storageQueueTag)) diff --git a/Extensions/FileTransfer/XMPPIncomingFileTransfer.m b/Extensions/FileTransfer/XMPPIncomingFileTransfer.m index c861ca7ae4..361a1d0275 100644 --- a/Extensions/FileTransfer/XMPPIncomingFileTransfer.m +++ b/Extensions/FileTransfer/XMPPIncomingFileTransfer.m @@ -153,7 +153,7 @@ - (void)sendIdentity:(XMPPIQ *)request XMPPIQ *iq = [XMPPIQ iqWithType:@"result" to:request.from elementID:request.elementID]; - [iq addAttributeWithName:@"from" stringValue:xmppStream.myJID.full]; + [iq addAttributeWithName:@"from" stringValue:self->xmppStream.myJID.full]; NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPDiscoInfoNamespace]; @@ -184,7 +184,7 @@ - (void)sendIdentity:(XMPPIQ *)request } [iq addChild:query]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; } }; @@ -208,7 +208,7 @@ - (void)sendSIOfferAcceptance:(XMPPIQ *)offer dispatch_block_t block = ^{ @autoreleasepool { // Store the sender's JID - _senderJID = offer.from; + self->_senderJID = offer.from; // Store the sid for later use NSXMLElement *inSi = offer.childElement; @@ -216,10 +216,10 @@ - (void)sendSIOfferAcceptance:(XMPPIQ *)offer // Store the size of the incoming data for later use NSXMLElement *inFile = [inSi elementForName:@"file"]; - _totalDataSize = [inFile attributeUnsignedIntegerValueForName:@"size"]; + self->_totalDataSize = [inFile attributeUnsignedIntegerValueForName:@"size"]; // Store the name of the file for later use - _receivedFileName = [inFile attributeStringValueForName:@"name"]; + self->_receivedFileName = [inFile attributeStringValueForName:@"name"]; // Outgoing XMPPIQ *iq = [XMPPIQ iqWithType:@"result" @@ -243,10 +243,10 @@ - (void)sendSIOfferAcceptance:(XMPPIQ *)offer // Prefer SOCKS5 if it's not disabled. if (!self.disableSOCKS5) { [value setStringValue:XMPPBytestreamsNamespace]; - _transferState = XMPPIFTStateWaitingForStreamhosts; + self->_transferState = XMPPIFTStateWaitingForStreamhosts; } else { [value setStringValue:XMPPIBBNamespace]; - _transferState = XMPPIFTStateWaitingForIBBOpen; + self->_transferState = XMPPIFTStateWaitingForIBBOpen; } [field addChild:value]; @@ -255,7 +255,7 @@ - (void)sendSIOfferAcceptance:(XMPPIQ *)offer [si addChild:feature]; [iq addChild:si]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; } }; @@ -281,10 +281,10 @@ - (void)sendIBBAcceptance:(XMPPIQ *)request XMPPIQ *iq = [XMPPIQ iqWithType:@"result" to:request.from elementID:request.elementID]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; // Prepare to receive data - _receivedData = [NSMutableData new]; + self->_receivedData = [NSMutableData new]; } }; @@ -313,21 +313,21 @@ - (void)processReceivedIBBDataIQ:(XMPPIQ *)received NSXMLElement *dataElem = received.childElement; NSData *temp = [[NSData alloc] initWithBase64EncodedString:dataElem.stringValue options:0]; - [_receivedData appendData:temp]; + [self->_receivedData appendData:temp]; // According the base64 encoding, it takes up 4/3 n bytes of space, so // we need to find the size of the data before base64. - _receivedDataSize += (3 * dataElem.stringValue.length) / 4; + self->_receivedDataSize += (3 * dataElem.stringValue.length) / 4; XMPPLogVerbose(@"Downloaded %lu/%lu bytes in IBB transfer.", - (unsigned long) _receivedDataSize, (unsigned long) _totalDataSize); + (unsigned long) self->_receivedDataSize, (unsigned long) self->_totalDataSize); - if (_receivedDataSize < _totalDataSize) { + if (self->_receivedDataSize < self->_totalDataSize) { // Send ack response XMPPIQ *iq = [XMPPIQ iqWithType:@"result" to:received.from elementID:received.elementID]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; } else { // We're finished! XMPPLogInfo(@"Finished downloading IBB data."); @@ -483,9 +483,9 @@ - (void)transferSuccess @autoreleasepool { [self cancelIBBTimer]; - [multicastDelegate xmppIncomingFileTransfer:self - didSucceedWithData:_receivedData - named:_receivedFileName]; + [self->multicastDelegate xmppIncomingFileTransfer:self + didSucceedWithData:self->_receivedData + named:self->_receivedFileName]; [self cleanUp]; } }; @@ -685,9 +685,9 @@ - (void)attemptStreamhostsConnection:(XMPPIQ *)iq dispatch_block_t block = ^{ @autoreleasepool { - _streamhostsQueryId = iq.elementID; - _transferState = XMPPIFTStateConnectingToStreamhosts; - _asyncSocket = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:moduleQueue]; + self->_streamhostsQueryId = iq.elementID; + self->_transferState = XMPPIFTStateConnectingToStreamhosts; + self->_asyncSocket = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:self->moduleQueue]; // Since we've already validated our IQ stanza, we can just pull the data NSArray *streamhosts = [iq.childElement elementsForName:@"streamhost"]; @@ -697,13 +697,13 @@ - (void)attemptStreamhostsConnection:(XMPPIQ *)iq uint16_t port = [streamhost attributeUInt32ValueForName:@"port"]; NSError *err; - if (![_asyncSocket connectToHost:host onPort:port error:&err]) { + if (![self->_asyncSocket connectToHost:host onPort:port error:&err]) { XMPPLogVerbose(@"%@: Unable to host:%@ port:%d error:%@", THIS_FILE, host, port, err); continue; } // If we make it this far, we've successfully connected to one of the hosts. - _streamhostUsed = [streamhost attributeStringValueForName:@"jid"]; + self->_streamhostUsed = [streamhost attributeStringValueForName:@"jid"]; return; } @@ -733,7 +733,7 @@ - (void)attemptStreamhostsConnection:(XMPPIQ *)iq [errorElem addChild:notAcceptable]; [errorIq addChild:errorElem]; - [xmppStream sendElement:errorIq]; + [self->xmppStream sendElement:errorIq]; NSString *errMsg = @"Unable to connect to any of the provided streamhosts."; [self failWithReason:errMsg error:nil]; @@ -781,7 +781,7 @@ - (void)socks5WriteMethod memcpy(byteBuf + 2, &methods, sizeof(methods)); NSData *data = [NSData dataWithBytesNoCopy:byteBuf length:3 freeWhenDone:YES]; - [_asyncSocket writeData:data withTimeout:TIMEOUT_WRITE tag:SOCKS_TAG_WRITE_METHOD]; + [self->_asyncSocket writeData:data withTimeout:TIMEOUT_WRITE tag:SOCKS_TAG_WRITE_METHOD]; } }; @@ -866,7 +866,7 @@ - (void)socks5ReadMethod:(NSData *)incomingData memcpy(byteBuf + 6 + hashlen, &port, sizeof(port)); NSData *data = [NSData dataWithBytesNoCopy:byteBuf length:47 freeWhenDone:YES]; - [_asyncSocket writeData:data withTimeout:TIMEOUT_WRITE tag:SOCKS_TAG_WRITE_CONNECT]; + [self->_asyncSocket writeData:data withTimeout:TIMEOUT_WRITE tag:SOCKS_TAG_WRITE_CONNECT]; XMPPLogVerbose(@"%@: writing connect request: %@", THIS_FILE, data); } @@ -926,7 +926,7 @@ - (void)socks5ReadReply:(NSData *)incomingData // // - XMPPIQ *iq = [XMPPIQ iqWithType:@"result" to:_senderJID elementID:_streamhostsQueryId]; + XMPPIQ *iq = [XMPPIQ iqWithType:@"result" to:self->_senderJID elementID:self->_streamhostsQueryId]; NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPBytestreamsNamespace]; @@ -934,19 +934,19 @@ - (void)socks5ReadReply:(NSData *)incomingData NSXMLElement *streamhostUsed = [NSXMLElement elementWithName:@"streamhost-used"]; [streamhostUsed addAttributeWithName:@"jid" - stringValue:_streamhostUsed]; + stringValue:self->_streamhostUsed]; [query addChild:streamhostUsed]; [iq addChild:query]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; // We're basically piping these to dev/null because we don't care. // However, we need to tag this read so we can start to read the actual // data once this read is finished. - [_asyncSocket readDataToLength:hostlen + 2 - withTimeout:TIMEOUT_READ - tag:SOCKS_TAG_READ_ADDRESS]; + [self->_asyncSocket readDataToLength:hostlen + 2 + withTimeout:TIMEOUT_READ + tag:SOCKS_TAG_READ_ADDRESS]; } }; diff --git a/Extensions/FileTransfer/XMPPOutgoingFileTransfer.m b/Extensions/FileTransfer/XMPPOutgoingFileTransfer.m index 6fd349ceed..4333a62562 100644 --- a/Extensions/FileTransfer/XMPPOutgoingFileTransfer.m +++ b/Extensions/FileTransfer/XMPPOutgoingFileTransfer.m @@ -184,20 +184,20 @@ - (BOOL)startFileTransfer:(NSError **)errPtr dispatch_block_t block = ^{ @autoreleasepool { - _transferState = XMPPOFTStateStarted; + self->_transferState = XMPPOFTStateStarted; - if (_pastRecipients[_recipientJID.full]) { - uint8_t methods = [_pastRecipients[_recipientJID.full] unsignedIntValue]; + if (self->_pastRecipients[self->_recipientJID.full]) { + uint8_t methods = [self->_pastRecipients[self->_recipientJID.full] unsignedIntValue]; if (methods & XMPPFileTransferStreamMethodBytestreams) { - _streamMethods |= XMPPFileTransferStreamMethodBytestreams; + self->_streamMethods |= XMPPFileTransferStreamMethodBytestreams; } if (methods & XMPPFileTransferStreamMethodIBB) { - _streamMethods |= XMPPFileTransferStreamMethodIBB; + self->_streamMethods |= XMPPFileTransferStreamMethodIBB; } - if (_streamMethods) { + if (self->_streamMethods) { [self querySIOffer]; return_from_block; } @@ -274,18 +274,18 @@ - (void)queryRecipientDiscoInfo dispatch_block_t block = ^{ @autoreleasepool { XMPPIQ *iq = [XMPPIQ iqWithType:@"get" - to:_recipientJID - elementID:[xmppStream generateUUID]]; + to:self->_recipientJID + elementID:[self->xmppStream generateUUID]]; NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPDiscoInfoNamespace]; [iq addChild:query]; - [_idTracker addElement:iq - target:self - selector:@selector(handleRecipientDiscoInfoQueryIQ:withInfo:) - timeout:OUTGOING_DEFAULT_TIMEOUT]; + [self->_idTracker addElement:iq + target:self + selector:@selector(handleRecipientDiscoInfoQueryIQ:withInfo:) + timeout:OUTGOING_DEFAULT_TIMEOUT]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; } }; @@ -340,12 +340,12 @@ - (void)querySIOffer dispatch_block_t block = ^{ @autoreleasepool { XMPPIQ *iq = [XMPPIQ iqWithType:@"set" - to:_recipientJID - elementID:[xmppStream generateUUID]]; - [iq addAttributeWithName:@"from" stringValue:xmppStream.myJID.full]; + to:self->_recipientJID + elementID:[self->xmppStream generateUUID]]; + [iq addAttributeWithName:@"from" stringValue:self->xmppStream.myJID.full]; // Store the sid; we'll need this later - self.sid = [xmppStream generateUUID]; + self.sid = [self->xmppStream generateUUID]; NSXMLElement *si = [NSXMLElement elementWithName:@"si" xmlns:XMPPSINamespace]; [si addAttributeWithName:@"id" stringValue:self.sid]; @@ -354,17 +354,17 @@ - (void)querySIOffer // Generate a random filename if one isn't provided NSString *fileName; - if (_outgoingFileName) { + if (self->_outgoingFileName) { // If there is a name provided, but a random one should be created, we'll keep the file ext. - if (_shouldGenerateRandomName) { - NSString *ext = [[_outgoingFileName componentsSeparatedByString:@"."] lastObject]; - fileName = [NSString stringWithFormat:@"%@.%@", [xmppStream generateUUID], ext]; + if (self->_shouldGenerateRandomName) { + NSString *ext = [[self->_outgoingFileName componentsSeparatedByString:@"."] lastObject]; + fileName = [NSString stringWithFormat:@"%@.%@", [self->xmppStream generateUUID], ext]; } else { - fileName = _outgoingFileName; + fileName = self->_outgoingFileName; } } else { - fileName = [xmppStream generateUUID]; + fileName = [self->xmppStream generateUUID]; } NSXMLElement *file = [NSXMLElement elementWithName:@"file" @@ -372,13 +372,13 @@ - (void)querySIOffer [file addAttributeWithName:@"name" stringValue:fileName]; [file addAttributeWithName:@"size" stringValue:[[NSString alloc] initWithFormat:@"%lu", - (unsigned long) [_outgoingData length]]];//TODO + (unsigned long) [self->_outgoingData length]]];//TODO [si addChild:file]; // Only include description if it's provided - if (_outgoingFileDescription) { + if (self->_outgoingFileDescription) { NSXMLElement *desc = [NSXMLElement elementWithName:@"desc" - stringValue:_outgoingFileDescription]; + stringValue:self->_outgoingFileDescription]; [file addChild:desc]; } @@ -413,12 +413,12 @@ - (void)querySIOffer [option2 addChild:value2]; } - [_idTracker addElement:iq + [self->_idTracker addElement:iq target:self selector:@selector(handleSIOfferQueryIQ:withInfo:) timeout:OUTGOING_DEFAULT_TIMEOUT]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; } }; @@ -441,21 +441,21 @@ - (void)collectStreamHosts dispatch_block_t block = ^{ @autoreleasepool { - _localIPAddress = [self getIPAddress:YES]; + self->_localIPAddress = [self getIPAddress:YES]; - if (!_localPort) { - _localPort = [XMPPOutgoingFileTransfer getRandomPort]; + if (!self->_localPort) { + self->_localPort = [XMPPOutgoingFileTransfer getRandomPort]; } - _streamhosts = [NSMutableArray new]; + self->_streamhosts = [NSMutableArray new]; // Don't send direct streamhost details if disabled. if (!self.disableDirectTransfers) { NSXMLElement *streamHost = [NSXMLElement elementWithName:@"streamhost"]; - [streamHost addAttributeWithName:@"jid" stringValue:xmppStream.myJID.full]; - [streamHost addAttributeWithName:@"host" stringValue:_localIPAddress]; - [streamHost addAttributeWithName:@"port" intValue:_localPort]; - [_streamhosts addObject:streamHost]; + [streamHost addAttributeWithName:@"jid" stringValue:self->xmppStream.myJID.full]; + [streamHost addAttributeWithName:@"host" stringValue:self->_localIPAddress]; + [streamHost addAttributeWithName:@"port" intValue:self->_localPort]; + [self->_streamhosts addObject:streamHost]; } [self queryProxyDiscoItems]; @@ -481,20 +481,20 @@ - (void)queryProxyDiscoItems dispatch_block_t block = ^{ @autoreleasepool { - NSString *toStr = xmppStream.myJID.domain; + NSString *toStr = self->xmppStream.myJID.domain; NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPDiscoItemsNamespace]; XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:[XMPPJID jidWithString:toStr] - elementID:[xmppStream generateUUID] + elementID:[self->xmppStream generateUUID] child:query]; - [_idTracker addElement:iq - target:self - selector:@selector(handleProxyDiscoItemsQueryIQ:withInfo:) - timeout:OUTGOING_DEFAULT_TIMEOUT]; + [self->_idTracker addElement:iq + target:self + selector:@selector(handleProxyDiscoItemsQueryIQ:withInfo:) + timeout:OUTGOING_DEFAULT_TIMEOUT]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; } }; @@ -521,17 +521,17 @@ - (void)queryProxyDiscoInfoWithJID:(XMPPJID *)jid @autoreleasepool { XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:jid - elementID:[xmppStream generateUUID]]; + elementID:[self->xmppStream generateUUID]]; NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPDiscoInfoNamespace]; [iq addChild:query]; - [_idTracker addElement:iq - target:self - selector:@selector(handleProxyDiscoInfoQueryIQ:withInfo:) - timeout:OUTGOING_DEFAULT_TIMEOUT]; + [self->_idTracker addElement:iq + target:self + selector:@selector(handleProxyDiscoInfoQueryIQ:withInfo:) + timeout:OUTGOING_DEFAULT_TIMEOUT]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; } }; @@ -556,17 +556,17 @@ - (void)queryProxyAddressWithJID:(XMPPJID *)jid @autoreleasepool { XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:jid - elementID:[xmppStream generateUUID]]; + elementID:[self->xmppStream generateUUID]]; NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPBytestreamsNamespace]; [iq addChild:query]; - [_idTracker addElement:iq - target:self - selector:@selector(handleProxyAddressQueryIQ:withInfo:) - timeout:OUTGOING_DEFAULT_TIMEOUT]; + [self->_idTracker addElement:iq + target:self + selector:@selector(handleProxyAddressQueryIQ:withInfo:) + timeout:OUTGOING_DEFAULT_TIMEOUT]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; } }; @@ -593,48 +593,48 @@ - (void)sendStreamHostsAndWaitForConnection dispatch_block_t block = ^{ @autoreleasepool { - if (_streamhosts.count < 1) { + if (self->_streamhosts.count < 1) { NSString *errMsg = - [NSString stringWithFormat:@"Unable to send streamhosts to %@", _recipientJID.full]; + [NSString stringWithFormat:@"Unable to send streamhosts to %@", self->_recipientJID.full]; [self failWithReason:errMsg error:nil]; return; } XMPPIQ *iq = [XMPPIQ iqWithType:@"set" - to:_recipientJID - elementID:[xmppStream generateUUID]]; + to:self->_recipientJID + elementID:[self->xmppStream generateUUID]]; [iq addAttributeWithName:@"xmlns" stringValue:@"jabber:client"]; - [iq addAttributeWithName:@"from" stringValue:xmppStream.myJID.full]; + [iq addAttributeWithName:@"from" stringValue:self->xmppStream.myJID.full]; NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPBytestreamsNamespace]; [query addAttributeWithName:@"sid" stringValue:self.sid]; - for (NSXMLElement *streamhost in _streamhosts) { + for (NSXMLElement *streamhost in self->_streamhosts) { [streamhost detach]; [query addChild:streamhost]; } [iq addChild:query]; - [_idTracker addElement:iq - target:self - selector:@selector(handleSentStreamhostsQueryIQ:withInfo:) - timeout:OUTGOING_DEFAULT_TIMEOUT]; + [self->_idTracker addElement:iq + target:self + selector:@selector(handleSentStreamhostsQueryIQ:withInfo:) + timeout:OUTGOING_DEFAULT_TIMEOUT]; // Send the list of streamhosts to the recipient - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; // Create a socket to listen for a direct connection - if (!_asyncSocket) { - _asyncSocket = [[GCDAsyncSocket alloc] initWithDelegate:self - delegateQueue:moduleQueue]; + if (!self->_asyncSocket) { + self->_asyncSocket = [[GCDAsyncSocket alloc] initWithDelegate:self + delegateQueue:self->moduleQueue]; } NSError *error; - if (![_asyncSocket acceptOnPort:_localPort error:&error]) { - NSString *errMsg = [NSString stringWithFormat:@"Failed to open port %d", _localPort]; + if (![self->_asyncSocket acceptOnPort:self->_localPort error:&error]) { + NSString *errMsg = [NSString stringWithFormat:@"Failed to open port %d", self->_localPort]; [self failWithReason:errMsg error:error]; } } @@ -676,25 +676,25 @@ - (void)beginIBBTransfer dispatch_block_t block = ^{ @autoreleasepool { XMPPIQ *iq = [XMPPIQ iqWithType:@"set" - to:_recipientJID - elementID:[xmppStream generateUUID]]; + to:self->_recipientJID + elementID:[self->xmppStream generateUUID]]; NSXMLElement *open = [NSXMLElement elementWithName:@"open" xmlns:XMPPIBBNamespace]; - [open addAttributeWithName:@"block-size" intValue:_blockSize]; + [open addAttributeWithName:@"block-size" intValue:self->_blockSize]; [open addAttributeWithName:@"sid" stringValue:self.sid]; [open addAttributeWithName:@"stanza" stringValue:@"iq"]; [iq addChild:open]; - [_idTracker addElement:iq - target:self - selector:@selector(handleInitialIBBQueryIQ:withInfo:) - timeout:OUTGOING_DEFAULT_TIMEOUT]; + [self->_idTracker addElement:iq + target:self + selector:@selector(handleInitialIBBQueryIQ:withInfo:) + timeout:OUTGOING_DEFAULT_TIMEOUT]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; // Convert our data to base64 for the IBB transmission - _outgoingDataBase64 = [_outgoingData base64EncodedStringWithOptions:0]; - _totalDataSize = _outgoingDataBase64.length; + self->_outgoingDataBase64 = [self->_outgoingData base64EncodedStringWithOptions:0]; + self->_totalDataSize = self->_outgoingDataBase64.length; } }; @@ -742,7 +742,7 @@ - (void)handleInitialIBBQueryIQ:(XMPPIQ *)iq withInfo:(XMPPBasicTrackingInfo *)i if ([errType isEqualToString:@"modify"] && [[errorElem childAtIndex:0].name isEqualToString:@"resource-constraint"]) { XMPPLogInfo(@"Responder prefers smaller IBB chunks. Shrinking block-size and retrying"); - _blockSize /= 2; + self->_blockSize /= 2; [self beginIBBTransfer]; return_from_block; } @@ -790,38 +790,38 @@ - (void)sendIBBData dispatch_block_t block = ^{ @autoreleasepool { - if (_sentDataSize < _totalDataSize) { + if (self->_sentDataSize < self->_totalDataSize) { XMPPIQ *iq = [XMPPIQ iqWithType:@"set" - to:_recipientJID - elementID:[xmppStream generateUUID]]; + to:self->_recipientJID + elementID:[self->xmppStream generateUUID]]; NSXMLElement *data = [NSXMLElement elementWithName:@"data" xmlns:XMPPIBBNamespace]; [data addAttributeWithName:@"sid" stringValue:self.sid]; - [data addAttributeWithName:@"seq" intValue:_outgoingDataBlockSeq++]; + [data addAttributeWithName:@"seq" intValue:self->_outgoingDataBlockSeq++]; // Get the base64 data for our block - NSUInteger length = _sentDataSize + _blockSize > _totalDataSize ? - _totalDataSize - _sentDataSize : _blockSize; - NSRange range = NSMakeRange(_sentDataSize, length); + NSUInteger length = self->_sentDataSize + self->_blockSize > self->_totalDataSize ? + self->_totalDataSize - self->_sentDataSize : self->_blockSize; + NSRange range = NSMakeRange(self->_sentDataSize, length); - NSString *dataString = [_outgoingDataBase64 substringWithRange:range]; - XMPPLogVerbose(@"Uploading %lu/%lu bytes in IBB transfer.", (unsigned long) _sentDataSize, - (unsigned long) _totalDataSize); + NSString *dataString = [self->_outgoingDataBase64 substringWithRange:range]; + XMPPLogVerbose(@"Uploading %lu/%lu bytes in IBB transfer.", (unsigned long) self->_sentDataSize, + (unsigned long) self->_totalDataSize); [data setStringValue:dataString]; [iq addChild:data]; - [_idTracker addElement:iq - target:self - selector:@selector(handleIBBTransferQueryIQ:withInfo:) - timeout:OUTGOING_DEFAULT_TIMEOUT]; + [self->_idTracker addElement:iq + target:self + selector:@selector(handleIBBTransferQueryIQ:withInfo:) + timeout:OUTGOING_DEFAULT_TIMEOUT]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; } else { XMPPLogInfo(@"IBB file transfer complete. Closing stream..."); // All the data has been sent. Alert the delegate that the transfer // was successful and close the stream. - [multicastDelegate xmppOutgoingFileTransferDidSucceed:self]; + [self->multicastDelegate xmppOutgoingFileTransferDidSucceed:self]; [self closeIBB]; } } @@ -878,10 +878,10 @@ - (void)handleIBBTransferQueryIQ:(XMPPIQ *)iq withInfo:(XMPPBasicTrackingInfo *) // Handle the scenario when the recipient closes the bytestream. NSXMLElement *close = [iq elementForName:@"close"]; if (close) { - if (_sentDataSize >= _totalDataSize) { + if (self->_sentDataSize >= self->_totalDataSize) { // We can assume the transfer was successful. - [multicastDelegate xmppOutgoingFileTransferDidSucceed:self]; - [multicastDelegate xmppOutgoingFileTransferIBBClosed:self]; + [self->multicastDelegate xmppOutgoingFileTransferDidSucceed:self]; + [self->multicastDelegate xmppOutgoingFileTransferIBBClosed:self]; // As per Examples 8-9 (XEP-0047), we SHOULD send the following // response to let the other party know it's alright to close the @@ -893,21 +893,21 @@ - (void)handleIBBTransferQueryIQ:(XMPPIQ *)iq withInfo:(XMPPBasicTrackingInfo *) // type='result'/> XMPPIQ *resultIq = [XMPPIQ iqWithType:@"result" - to:_recipientJID + to:self->_recipientJID elementID:iq.elementID]; - [xmppStream sendElement:resultIq]; + [self->xmppStream sendElement:resultIq]; } else { // There must have been a reason to close, but we don't know it. // Therefore, the transfer might not have been successful. [self failWithReason:@"Recipient closed IBB stream." error:nil]; - [multicastDelegate xmppOutgoingFileTransferIBBClosed:self]; + [self->multicastDelegate xmppOutgoingFileTransferIBBClosed:self]; } } // At this point, we're assuming that we've received the stanza shown // above and the recipient has successfully received the data we sent, // so we should now send them the next block of data. - _sentDataSize += _blockSize; + self->_sentDataSize += self->_blockSize; [self sendIBBData]; XMPPLogVerbose( @@ -939,18 +939,18 @@ - (void)closeIBB dispatch_block_t block = ^{ @autoreleasepool { XMPPIQ *iq = [XMPPIQ iqWithType:@"set" - to:_recipientJID - elementID:[xmppStream generateUUID]]; + to:self->_recipientJID + elementID:[self->xmppStream generateUUID]]; NSXMLElement *close = [NSXMLElement elementWithName:@"close" xmlns:XMPPIBBNamespace]; [close addAttributeWithName:@"sid" stringValue:self.sid]; [iq addChild:close]; - [_idTracker addElement:iq - target:self - selector:@selector(handleCloseIBBQueryIQ:withInfo:) - timeout:OUTGOING_DEFAULT_TIMEOUT]; + [self->_idTracker addElement:iq + target:self + selector:@selector(handleCloseIBBQueryIQ:withInfo:) + timeout:OUTGOING_DEFAULT_TIMEOUT]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; } }; @@ -990,7 +990,7 @@ - (void)handleCloseIBBQueryIQ:(XMPPIQ *)iq withInfo:(XMPPBasicTrackingInfo *)inf } // We're assuming that if it makes it this far, it's the response we want - [multicastDelegate xmppOutgoingFileTransferIBBClosed:self]; + [self->multicastDelegate xmppOutgoingFileTransferIBBClosed:self]; } }; @@ -1071,7 +1071,7 @@ - (void)handleRecipientDiscoInfoQueryIQ:(XMPPIQ *)iq withInfo:(XMPPBasicTracking XMPPLogInfo(@"%@: %@", THIS_FILE, errMsg); NSError *err = [self localErrorWithMessage:errMsg code:-1]; - [multicastDelegate xmppOutgoingFileTransfer:self didFailWithError:err]; + [self->multicastDelegate xmppOutgoingFileTransfer:self didFailWithError:err]; return_from_block; } @@ -1083,14 +1083,14 @@ - (void)handleRecipientDiscoInfoQueryIQ:(XMPPIQ *)iq withInfo:(XMPPBasicTracking // add the ability to restart the transfer using IBB if bytestreams // fail, but only if the stream-method is available. if (hasSOCKS5) { - _streamMethods |= XMPPFileTransferStreamMethodBytestreams; + self->_streamMethods |= XMPPFileTransferStreamMethodBytestreams; } if (hasIBB) { - _streamMethods |= XMPPFileTransferStreamMethodIBB; + self->_streamMethods |= XMPPFileTransferStreamMethodIBB; } - _pastRecipients[_recipientJID.full] = @(_streamMethods); + self->_pastRecipients[self->_recipientJID.full] = @(self->_streamMethods); } }; @@ -1311,7 +1311,7 @@ - (void)handleProxyAddressQueryIQ:(XMPPIQ *)iq withInfo:(XMPPBasicTrackingInfo * // Detach the streamHost object so it can later be added to a query [streamHost detach]; - [_streamhosts addObject:streamHost]; + [self->_streamhosts addObject:streamHost]; [self sendStreamHostsAndWaitForConnection]; } @@ -1365,56 +1365,56 @@ - (void)handleSentStreamhostsQueryIQ:(XMPPIQ *)iq withInfo:(XMPPBasicTrackingInf NSString *jid = [streamhostUsed attributeStringValueForName:@"jid"]; XMPPLogVerbose(@"%@: streamhost-used received with jid: %@", THIS_FILE, jid); - if ([jid isEqualToString:xmppStream.myJID.full]) { + if ([jid isEqualToString:self->xmppStream.myJID.full]) { XMPPLogVerbose(@"%@: writing data via direct connection.", THIS_FILE); - [_outgoingSocket writeData:_outgoingData - withTimeout:TIMEOUT_WRITE - tag:SOCKS_TAG_WRITE_DATA]; + [self->_outgoingSocket writeData:self->_outgoingData + withTimeout:TIMEOUT_WRITE + tag:SOCKS_TAG_WRITE_DATA]; return; } XMPPLogVerbose(@"%@: unable use a direct connection; trying the provided streamhost.", THIS_FILE); - if (_outgoingSocket) { - if (_outgoingSocket.isConnected) { - [_outgoingSocket disconnect]; + if (self->_outgoingSocket) { + if (self->_outgoingSocket.isConnected) { + [self->_outgoingSocket disconnect]; } - _outgoingSocket = nil; + self->_outgoingSocket = nil; } // We need to get the streamhost which we discovered earlier as a proxy. NSXMLElement *proxy; - for (NSXMLElement *streamhost in _streamhosts) { + for (NSXMLElement *streamhost in self->_streamhosts) { if ([jid isEqualToString:[streamhost attributeStringValueForName:@"jid"]]) { proxy = streamhost; - _proxyJID = [XMPPJID jidWithString:jid]; + self->_proxyJID = [XMPPJID jidWithString:jid]; break; } } - if (_asyncSocket) { - [_asyncSocket setDelegate:nil]; - [_asyncSocket disconnect]; + if (self->_asyncSocket) { + [self->_asyncSocket setDelegate:nil]; + [self->_asyncSocket disconnect]; } - if (!_asyncSocket) { - _asyncSocket = [[GCDAsyncSocket alloc] initWithDelegate:self - delegateQueue:_outgoingQueue]; + if (!self->_asyncSocket) { + self->_asyncSocket = [[GCDAsyncSocket alloc] initWithDelegate:self + delegateQueue:self->_outgoingQueue]; } else { - [_asyncSocket setDelegate:self]; + [self->_asyncSocket setDelegate:self]; } NSError *err; NSString *proxyHost = [proxy attributeStringValueForName:@"host"]; uint16_t proxyPort = [proxy attributeUnsignedIntegerValueForName:@"port"]; - if (![_asyncSocket connectToHost:proxyHost onPort:proxyPort error:&err]) { + if (![self->_asyncSocket connectToHost:proxyHost onPort:proxyPort error:&err]) { [self failWithReason:@"Unable to connect to proxy." error:err]; return_from_block; } - _transferState = XMPPOFTStateConnectingToProxy; + self->_transferState = XMPPOFTStateConnectingToProxy; // See the GCDAsyncSocket Delegate for the next steps. } }; @@ -1445,7 +1445,7 @@ - (void)handleSentActivateQueryIQ:(XMPPIQ *)iq withInfo:(XMPPBasicTrackingInfo * } XMPPLogVerbose(@"Receive response to activate. Starting the actual data transfer now..."); - [_asyncSocket writeData:_outgoingData withTimeout:TIMEOUT_WRITE tag:SOCKS_TAG_WRITE_DATA]; + [self->_asyncSocket writeData:self->_outgoingData withTimeout:TIMEOUT_WRITE tag:SOCKS_TAG_WRITE_DATA]; } }; @@ -1597,8 +1597,8 @@ - (void)transferSuccess dispatch_block_t block = ^{ @autoreleasepool { - _transferState = XMPPOFTStateFinished; - [multicastDelegate xmppOutgoingFileTransferDidSucceed:self]; + self->_transferState = XMPPOFTStateFinished; + [self->multicastDelegate xmppOutgoingFileTransferDidSucceed:self]; [self cleanUp]; } }; @@ -1820,9 +1820,9 @@ - (void)socks5ReadMethod:(NSData *)incomingData NSData *responseData = [NSData dataWithBytesNoCopy:byteBuf length:2 freeWhenDone:YES]; XMPPLogVerbose(@"%@: writing SOCKS5 auth response: %@", THIS_FILE, responseData); - [_outgoingSocket writeData:responseData - withTimeout:TIMEOUT_WRITE - tag:SOCKS_TAG_WRITE_METHOD]; + [self->_outgoingSocket writeData:responseData + withTimeout:TIMEOUT_WRITE + tag:SOCKS_TAG_WRITE_METHOD]; } } }; @@ -1879,9 +1879,9 @@ - (void)socks5ReadRequest:(NSData *)incomingData // Read the length byte + the 40-byte SHA1 + 2-byte address NSUInteger length = 43; if (atyp == 3) { - [_outgoingSocket readDataToLength:length - withTimeout:TIMEOUT_READ - tag:SOCKS_TAG_READ_DOMAIN]; + [self->_outgoingSocket readDataToLength:length + withTimeout:TIMEOUT_READ + tag:SOCKS_TAG_READ_DOMAIN]; } else { [self failWithReason:@"ATYP value is invalid." error:nil]; } @@ -1939,7 +1939,7 @@ - (void)socks5ReadDomain:(NSData *)incomingData // BND.PORT = 0x00 // 0x00 - const char *host = [_localIPAddress UTF8String]; + const char *host = [self->_localIPAddress UTF8String]; NSUInteger numBytes = 5 + strlen(host) + 2; @@ -1970,11 +1970,11 @@ - (void)socks5ReadDomain:(NSData *)incomingData *responseData = [NSData dataWithBytesNoCopy:byteBuf length:numBytes freeWhenDone:YES]; XMPPLogVerbose(@"%@: writing SOCKS5 auth response: %@", THIS_FILE, responseData); - [_outgoingSocket writeData:responseData - withTimeout:TIMEOUT_WRITE - tag:SOCKS_TAG_WRITE_REPLY]; + [self->_outgoingSocket writeData:responseData + withTimeout:TIMEOUT_WRITE + tag:SOCKS_TAG_WRITE_REPLY]; - _transferState = XMPPOFTStateSOCKSLive; + self->_transferState = XMPPOFTStateSOCKSLive; // Now we wait for a IQ stanza before sending the data. } @@ -2021,7 +2021,7 @@ - (void)socks5WriteProxyMethod memcpy(byteBuf + 2, &methods, sizeof(methods)); NSData *data = [NSData dataWithBytesNoCopy:byteBuf length:3 freeWhenDone:YES]; - [_asyncSocket writeData:data withTimeout:TIMEOUT_WRITE tag:SOCKS_TAG_WRITE_PROXY_METHOD]; + [self->_asyncSocket writeData:data withTimeout:TIMEOUT_WRITE tag:SOCKS_TAG_WRITE_PROXY_METHOD]; } }; @@ -2106,7 +2106,7 @@ - (void)socks5ReadProxyMethod:(NSData *)incomingData memcpy(byteBuf + 6 + hashlen, &port, sizeof(port)); NSData *data = [NSData dataWithBytesNoCopy:byteBuf length:47 freeWhenDone:YES]; - [_asyncSocket writeData:data withTimeout:TIMEOUT_WRITE tag:SOCKS_TAG_WRITE_PROXY_CONNECT]; + [self->_asyncSocket writeData:data withTimeout:TIMEOUT_WRITE tag:SOCKS_TAG_WRITE_PROXY_CONNECT]; XMPPLogVerbose(@"%@: writing connect request: %@", THIS_FILE, data); } @@ -2149,7 +2149,7 @@ - (void)socks5ReadProxyReply:(NSData *)incomingData } // Read those bytes off into oblivion... - [_asyncSocket readDataToLength:hostlen + 2 withTimeout:TIMEOUT_READ tag:-1]; + [self->_asyncSocket readDataToLength:hostlen + 2 withTimeout:TIMEOUT_READ tag:-1]; // According to XEP-0065 Example 23, we don't need to validate the // address we were sent (at least that is how I interpret it), so we @@ -2157,7 +2157,7 @@ - (void)socks5ReadProxyReply:(NSData *)incomingData // sending the data once we receive our response. NSXMLElement *activate = [NSXMLElement elementWithName:@"activate" - stringValue:_recipientJID.full]; + stringValue:self->_recipientJID.full]; NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:@"http://jabber.org/protocol/bytestreams"]; @@ -2165,16 +2165,16 @@ - (void)socks5ReadProxyReply:(NSData *)incomingData [query addChild:activate]; XMPPIQ *iq = [XMPPIQ iqWithType:@"set" - to:_proxyJID - elementID:[xmppStream generateUUID] + to:self->_proxyJID + elementID:[self->xmppStream generateUUID] child:query]; - [_idTracker addElement:iq - target:self - selector:@selector(handleSentActivateQueryIQ:withInfo:) - timeout:OUTGOING_DEFAULT_TIMEOUT]; + [self->_idTracker addElement:iq + target:self + selector:@selector(handleSentActivateQueryIQ:withInfo:) + timeout:OUTGOING_DEFAULT_TIMEOUT]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; } }; diff --git a/Extensions/OMEMO/OMEMOModule.m b/Extensions/OMEMO/OMEMOModule.m index a665d6b4e5..6bab077676 100644 --- a/Extensions/OMEMO/OMEMOModule.m +++ b/Extensions/OMEMO/OMEMOModule.m @@ -62,8 +62,8 @@ - (BOOL)activate:(XMPPStream *)aXmppStream if ([super activate:aXmppStream]) { [self performBlock:^{ - [xmppStream autoAddDelegate:self delegateQueue:moduleQueue toModulesOfClass:[XMPPCapabilities class]]; - _tracker = [[XMPPIDTracker alloc] initWithStream:aXmppStream dispatchQueue:moduleQueue]; + [self->xmppStream autoAddDelegate:self delegateQueue:self->moduleQueue toModulesOfClass:[XMPPCapabilities class]]; + self->_tracker = [[XMPPIDTracker alloc] initWithStream:aXmppStream dispatchQueue:self->moduleQueue]; }]; return YES; } @@ -73,9 +73,9 @@ - (BOOL)activate:(XMPPStream *)aXmppStream - (void) deactivate { [self performBlock:^{ - [_tracker removeAllIDs]; - _tracker = nil; - [xmppStream removeAutoDelegate:self delegateQueue:moduleQueue fromModulesOfClass:[XMPPCapabilities class]]; + [self->_tracker removeAllIDs]; + self->_tracker = nil; + [self->xmppStream removeAutoDelegate:self delegateQueue:self->moduleQueue fromModulesOfClass:[XMPPCapabilities class]]; }]; [super deactivate]; } @@ -100,7 +100,7 @@ - (void) publishDeviceIds:(NSArray*)deviceIds elementId:(nullable NSS } [weakMulticast omemo:strongSelf publishedDeviceIds:deviceIds responseIq:responseIq outgoingIq:iq]; } timeout:30]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; }]; } @@ -115,7 +115,7 @@ - (void) fetchDeviceIdsForJID:(XMPPJID*)jid if ((!responseIq || [responseIq isErrorIQ]) && !isOurJID) { // timeout XMPPLogWarn(@"fetchDeviceIdsForJID error: %@ %@", info.element, responseIq); - [multicastDelegate omemo:self failedToFetchDeviceIdsForJID:jid errorIq:responseIq outgoingIq:(XMPPIQ*)info.element]; + [self->multicastDelegate omemo:self failedToFetchDeviceIdsForJID:jid errorIq:responseIq outgoingIq:(XMPPIQ*)info.element]; return; } @@ -131,7 +131,7 @@ - (void) fetchDeviceIdsForJID:(XMPPJID*)jid // Should always be the account bare jid. bareJID = [[[info element] to] bareJID]; } - [multicastDelegate omemo:self deviceListUpdate:devices fromJID:bareJID incomingElement:responseIq]; + [self->multicastDelegate omemo:self deviceListUpdate:devices fromJID:bareJID incomingElement:responseIq]; [self processIncomingDeviceIds:devices fromJID:bareJID]; }]; } @@ -143,7 +143,7 @@ - (void) fetchDeviceIdsForJID:(nonnull XMPPJID*)jid NSString *eid = [self fixElementId:elementId]; XMPPIQ *iq = [XMPPIQ omemo_iqFetchDeviceIdsForJID:jid elementId:eid xmlNamespace:self.xmlNamespace]; [self.tracker addElement:iq block:completion timeout:30]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; }]; } @@ -167,7 +167,7 @@ - (void) publishBundle:(OMEMOBundle*)bundle } [weakMulticast omemo:strongSelf publishedBundle:bundle responseIq:responseIq outgoingIq:iq]; } timeout:30]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; }]; } @@ -199,7 +199,7 @@ - (void) fetchBundleForDeviceId:(uint32_t)deviceId [weakMulticast omemo:strongSelf failedToFetchBundleForDeviceId:deviceId fromJID:jid errorIq:responseIq outgoingIq:iq]; } } timeout:30]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; }]; } diff --git a/Extensions/ProcessOne/XMPPProcessOne.m b/Extensions/ProcessOne/XMPPProcessOne.m index f817db3a31..90d7a16f9c 100644 --- a/Extensions/ProcessOne/XMPPProcessOne.m +++ b/Extensions/ProcessOne/XMPPProcessOne.m @@ -94,7 +94,7 @@ - (NSXMLElement *)pushConfiguration __block NSXMLElement *result = nil; dispatch_sync(moduleQueue, ^{ - result = [pushConfiguration copy]; + result = [self->pushConfiguration copy]; }); return result; @@ -107,16 +107,16 @@ - (void)setPushConfiguration:(NSXMLElement *)pushConfig dispatch_block_t block = ^{ - if (pushConfiguration == nil && newPushConfiguration == nil) + if (self->pushConfiguration == nil && newPushConfiguration == nil) { return; } - pushConfiguration = newPushConfiguration; - pushConfigurationSent = NO; - pushConfigurationConfirmed = NO; + self->pushConfiguration = newPushConfiguration; + self->pushConfigurationSent = NO; + self->pushConfigurationConfirmed = NO; - if ([xmppStream isAuthenticated]) + if ([self->xmppStream isAuthenticated]) { [self sendPushConfiguration]; } diff --git a/Extensions/Reconnect/XMPPReconnect.m b/Extensions/Reconnect/XMPPReconnect.m index 8ec2097e1c..337c4ad446 100644 --- a/Extensions/Reconnect/XMPPReconnect.m +++ b/Extensions/Reconnect/XMPPReconnect.m @@ -123,7 +123,7 @@ - (BOOL)autoReconnect __block BOOL result = NO; dispatch_block_t block = ^{ - result = (config & kAutoReconnect) ? YES : NO; + result = (self->config & kAutoReconnect) ? YES : NO; }; if (dispatch_get_specific(moduleQueueTag)) @@ -138,9 +138,9 @@ - (void)setAutoReconnect:(BOOL)flag { dispatch_block_t block = ^{ if (flag) - config |= kAutoReconnect; + self->config |= kAutoReconnect; else - config &= ~kAutoReconnect; + self->config &= ~kAutoReconnect; }; if (dispatch_get_specific(moduleQueueTag)) @@ -225,7 +225,7 @@ - (void)manualStart { dispatch_block_t block = ^{ @autoreleasepool { - if ([xmppStream isDisconnected] && [self manuallyStarted] == NO) + if ([self->xmppStream isDisconnected] && [self manuallyStarted] == NO) { [self setManuallyStarted:YES]; @@ -246,11 +246,11 @@ - (void)stop // Clear all flags to disable any further reconnect attemts regardless of the state we're in. - flags = 0; + self->flags = 0; // Stop any planned reconnect attempts and stop monitoring the network. - reconnectTicket++; + self->reconnectTicket++; [self teardownReconnectTimer]; [self teardownNetworkMonitoring]; @@ -621,37 +621,37 @@ - (void)maybeAttemptReconnectWithReachabilityFlags:(SCNetworkReachabilityFlags)r shouldAttemptReconnect = (dispatch_semaphore_wait(delSemaphore, DISPATCH_TIME_NOW) != 0); } - dispatch_async(moduleQueue, ^{ @autoreleasepool { + dispatch_async(self->moduleQueue, ^{ @autoreleasepool { [self setQueryingDelegates:NO]; if (shouldAttemptReconnect) { [self setShouldRestartReconnect:NO]; - previousReachabilityFlags = reachabilityFlags; + self->previousReachabilityFlags = reachabilityFlags; if (self.usesOldSchoolSecureConnect) { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - [xmppStream oldSchoolSecureConnectWithTimeout:XMPPStreamTimeoutNone error:nil]; + [self->xmppStream oldSchoolSecureConnectWithTimeout:XMPPStreamTimeoutNone error:nil]; #pragma clang diagnostic pop } else { - [xmppStream connectWithTimeout:XMPPStreamTimeoutNone error:nil]; + [self->xmppStream connectWithTimeout:XMPPStreamTimeoutNone error:nil]; } } else if ([self shouldRestartReconnect]) { [self setShouldRestartReconnect:NO]; - previousReachabilityFlags = IMPOSSIBLE_REACHABILITY_FLAGS; + self->previousReachabilityFlags = IMPOSSIBLE_REACHABILITY_FLAGS; [self maybeAttemptReconnect]; } else { - previousReachabilityFlags = IMPOSSIBLE_REACHABILITY_FLAGS; + self->previousReachabilityFlags = IMPOSSIBLE_REACHABILITY_FLAGS; } }}); diff --git a/Extensions/Roster/CoreDataStorage/XMPPRosterCoreDataStorage.m b/Extensions/Roster/CoreDataStorage/XMPPRosterCoreDataStorage.m index 4fe7e41bb3..8101757b20 100644 --- a/Extensions/Roster/CoreDataStorage/XMPPRosterCoreDataStorage.m +++ b/Extensions/Roster/CoreDataStorage/XMPPRosterCoreDataStorage.m @@ -266,7 +266,7 @@ - (void)beginRosterPopulationForXMPPStream:(XMPPStream *)stream withVersion:(NSS [self scheduleBlock:^{ - [rosterPopulationSet addObject:[NSNumber xmpp_numberWithPtr:(__bridge void *)stream]]; + [self->rosterPopulationSet addObject:[NSNumber xmpp_numberWithPtr:(__bridge void *)stream]]; // Clear anything already in the roster core data store. // @@ -280,7 +280,7 @@ - (void)beginRosterPopulationForXMPPStream:(XMPPStream *)stream withVersion:(NSS NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; [fetchRequest setEntity:entity]; - [fetchRequest setFetchBatchSize:saveThreshold]; + [fetchRequest setFetchBatchSize:self->saveThreshold]; if (stream) { @@ -308,7 +308,7 @@ - (void)endRosterPopulationForXMPPStream:(XMPPStream *)stream [self scheduleBlock:^{ - [rosterPopulationSet removeObject:[NSNumber xmpp_numberWithPtr:(__bridge void *)stream]]; + [self->rosterPopulationSet removeObject:[NSNumber xmpp_numberWithPtr:(__bridge void *)stream]]; }]; } @@ -324,7 +324,7 @@ - (void)handleRosterItem:(NSXMLElement *)itemSubElement xmppStream:(XMPPStream * NSManagedObjectContext *moc = [self managedObjectContext]; - if ([rosterPopulationSet containsObject:[NSNumber xmpp_numberWithPtr:(__bridge void *)stream]]) + if ([self->rosterPopulationSet containsObject:[NSNumber xmpp_numberWithPtr:(__bridge void *)stream]]) { NSString *streamBareJidStr = [[self myJIDForXMPPStream:stream] bare]; @@ -457,7 +457,7 @@ - (void)clearAllUsersAndResourcesForXMPPStream:(XMPPStream *)stream NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; [fetchRequest setEntity:entity]; - [fetchRequest setFetchBatchSize:saveThreshold]; + [fetchRequest setFetchBatchSize:self->saveThreshold]; if (stream) { @@ -476,7 +476,7 @@ - (void)clearAllUsersAndResourcesForXMPPStream:(XMPPStream *)stream { [moc deleteObject:user]; - if (++unsavedCount >= saveThreshold) + if (++unsavedCount >= self->saveThreshold) { [self save]; unsavedCount = 0; @@ -502,7 +502,7 @@ - (NSArray *)jidsForXMPPStream:(XMPPStream *)stream{ NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; [fetchRequest setEntity:entity]; - [fetchRequest setFetchBatchSize:saveThreshold]; + [fetchRequest setFetchBatchSize:self->saveThreshold]; if (stream) { diff --git a/Extensions/Roster/MemoryStorage/XMPPRosterMemoryStorage.m b/Extensions/Roster/MemoryStorage/XMPPRosterMemoryStorage.m index 57d4f0f5d4..40ef0c181f 100644 --- a/Extensions/Roster/MemoryStorage/XMPPRosterMemoryStorage.m +++ b/Extensions/Roster/MemoryStorage/XMPPRosterMemoryStorage.m @@ -279,7 +279,7 @@ - (XMPPUserMemoryStorageObject *)myUser __block XMPPUserMemoryStorageObject *result; dispatch_sync(parentQueue, ^{ - result = [myUser copy]; + result = [self->myUser copy]; }); return result; @@ -306,7 +306,7 @@ - (XMPPResourceMemoryStorageObject *)myResource dispatch_sync(parentQueue, ^{ XMPPResourceMemoryStorageObject *resource = - (XMPPResourceMemoryStorageObject *)[myUser resourceForJID:myJID]; + (XMPPResourceMemoryStorageObject *)[self->myUser resourceForJID:self->myJID]; result = [resource copy]; }); diff --git a/Extensions/Roster/XMPPRoster.m b/Extensions/Roster/XMPPRoster.m index 839e7eddd4..3231668c09 100644 --- a/Extensions/Roster/XMPPRoster.m +++ b/Extensions/Roster/XMPPRoster.m @@ -101,7 +101,7 @@ - (BOOL)activate:(XMPPStream *)aXmppStream if ([module isKindOfClass:[XMPPMUC class]]) { - [mucModules add:(__bridge void *)module]; + [self->mucModules add:(__bridge void *)module]; } }]; } @@ -119,8 +119,8 @@ - (void)deactivate dispatch_block_t block = ^{ @autoreleasepool { - [xmppIDTracker removeAllIDs]; - xmppIDTracker = nil; + [self->xmppIDTracker removeAllIDs]; + self->xmppIDTracker = nil; }}; @@ -167,7 +167,7 @@ - (BOOL)autoFetchRoster __block BOOL result = NO; dispatch_block_t block = ^{ - result = (config & kAutoFetchRoster) ? YES : NO; + result = (self->config & kAutoFetchRoster) ? YES : NO; }; if (dispatch_get_specific(moduleQueueTag)) @@ -183,9 +183,9 @@ - (void)setAutoFetchRoster:(BOOL)flag dispatch_block_t block = ^{ if (flag) - config |= kAutoFetchRoster; + self->config |= kAutoFetchRoster; else - config &= ~kAutoFetchRoster; + self->config &= ~kAutoFetchRoster; }; if (dispatch_get_specific(moduleQueueTag)) @@ -199,7 +199,7 @@ - (BOOL)autoClearAllUsersAndResources __block BOOL result = NO; dispatch_block_t block = ^{ - result = (config & kAutoClearAllUsersAndResources) ? YES : NO; + result = (self->config & kAutoClearAllUsersAndResources) ? YES : NO; }; if (dispatch_get_specific(moduleQueueTag)) @@ -215,9 +215,9 @@ - (void)setAutoClearAllUsersAndResources:(BOOL)flag dispatch_block_t block = ^{ if (flag) - config |= kAutoClearAllUsersAndResources; + self->config |= kAutoClearAllUsersAndResources; else - config &= ~kAutoClearAllUsersAndResources; + self->config &= ~kAutoClearAllUsersAndResources; }; if (dispatch_get_specific(moduleQueueTag)) @@ -231,7 +231,7 @@ - (BOOL)autoAcceptKnownPresenceSubscriptionRequests __block BOOL result = NO; dispatch_block_t block = ^{ - result = (config & kAutoAcceptKnownPresenceSubscriptionRequests) ? YES : NO; + result = (self->config & kAutoAcceptKnownPresenceSubscriptionRequests) ? YES : NO; }; if (dispatch_get_specific(moduleQueueTag)) @@ -247,9 +247,9 @@ - (void)setAutoAcceptKnownPresenceSubscriptionRequests:(BOOL)flag dispatch_block_t block = ^{ if (flag) - config |= kAutoAcceptKnownPresenceSubscriptionRequests; + self->config |= kAutoAcceptKnownPresenceSubscriptionRequests; else - config &= ~kAutoAcceptKnownPresenceSubscriptionRequests; + self->config &= ~kAutoAcceptKnownPresenceSubscriptionRequests; }; if (dispatch_get_specific(moduleQueueTag)) @@ -263,7 +263,7 @@ - (BOOL)allowRosterlessOperation __block BOOL result = NO; dispatch_block_t block = ^{ - result = (config & kRosterlessOperation) ? YES : NO; + result = (self->config & kRosterlessOperation) ? YES : NO; }; if (dispatch_get_specific(moduleQueueTag)) @@ -279,9 +279,9 @@ - (void)setAllowRosterlessOperation:(BOOL)flag dispatch_block_t block = ^{ if (flag) - config |= kRosterlessOperation; + self->config |= kRosterlessOperation; else - config &= ~kRosterlessOperation; + self->config &= ~kRosterlessOperation; }; if (dispatch_get_specific(moduleQueueTag)) @@ -296,7 +296,7 @@ - (BOOL)hasRequestedRoster __block BOOL result = NO; dispatch_block_t block = ^{ - result = (flags & kRequestedRoster) ? YES : NO; + result = (self->flags & kRequestedRoster) ? YES : NO; }; if (dispatch_get_specific(moduleQueueTag)) @@ -312,7 +312,7 @@ - (BOOL)isPopulating{ __block BOOL result = NO; dispatch_block_t block = ^{ - result = (flags & kPopulatingRoster) ? YES : NO; + result = (self->flags & kPopulatingRoster) ? YES : NO; }; if (dispatch_get_specific(moduleQueueTag)) @@ -328,7 +328,7 @@ - (BOOL)hasRoster __block BOOL result = NO; dispatch_block_t block = ^{ - result = (flags & kHasRoster) ? YES : NO; + result = (self->flags & kHasRoster) ? YES : NO; }; if (dispatch_get_specific(moduleQueueTag)) @@ -703,15 +703,15 @@ - (void)fetchRosterVersion:(NSString *)version if (version) [query addAttributeWithName:@"ver" stringValue:version]; - XMPPIQ *iq = [XMPPIQ iqWithType:@"get" elementID:[xmppStream generateUUID]]; + XMPPIQ *iq = [XMPPIQ iqWithType:@"get" elementID:[self->xmppStream generateUUID]]; [iq addChild:query]; - [xmppIDTracker addElement:iq + [self->xmppIDTracker addElement:iq target:self selector:@selector(handleFetchRosterQueryIQ:withInfo:) timeout:60]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; [self _setRequestedRoster:YES]; }}; @@ -737,10 +737,10 @@ - (void)handleFetchRosterQueryIQ:(XMPPIQ *)iq withInfo:(XMPPBasicTrackingInfo *) if (!hasRoster) { - [xmppRosterStorage clearAllUsersAndResourcesForXMPPStream:xmppStream]; - [self _setPopulatingRoster:YES]; - [multicastDelegate xmppRosterDidBeginPopulating:self withVersion:version]; - [xmppRosterStorage beginRosterPopulationForXMPPStream:xmppStream withVersion:version]; + [self->xmppRosterStorage clearAllUsersAndResourcesForXMPPStream:self->xmppStream]; + [self _setPopulatingRoster:YES]; + [self->multicastDelegate xmppRosterDidBeginPopulating:self withVersion:version]; + [self->xmppRosterStorage beginRosterPopulationForXMPPStream:self->xmppStream withVersion:version]; } NSArray *items = [query elementsForName:@"item"]; @@ -751,18 +751,18 @@ - (void)handleFetchRosterQueryIQ:(XMPPIQ *)iq withInfo:(XMPPBasicTrackingInfo *) // We should have our roster now [self _setHasRoster:YES]; - [self _setPopulatingRoster:NO]; - [multicastDelegate xmppRosterDidEndPopulating:self]; - [xmppRosterStorage endRosterPopulationForXMPPStream:xmppStream]; + [self _setPopulatingRoster:NO]; + [self->multicastDelegate xmppRosterDidEndPopulating:self]; + [self->xmppRosterStorage endRosterPopulationForXMPPStream:self->xmppStream]; // Process any premature presence elements we received. - for (XMPPPresence *presence in earlyPresenceElements) + for (XMPPPresence *presence in self->earlyPresenceElements) { - [self xmppStream:xmppStream didReceivePresence:presence]; + [self xmppStream:self->xmppStream didReceivePresence:presence]; } - [earlyPresenceElements removeAllObjects]; + [self->earlyPresenceElements removeAllObjects]; } }}; diff --git a/Extensions/XEP-0009/XMPPJabberRPCModule.m b/Extensions/XEP-0009/XMPPJabberRPCModule.m index 1177ebc08f..dd20bf4aca 100644 --- a/Extensions/XEP-0009/XMPPJabberRPCModule.m +++ b/Extensions/XEP-0009/XMPPJabberRPCModule.m @@ -107,7 +107,7 @@ - (NSTimeInterval)defaultTimeout __block NSTimeInterval result; dispatch_block_t block = ^{ - result = defaultTimeout; + result = self->defaultTimeout; }; if (dispatch_get_specific(moduleQueueTag)) @@ -122,7 +122,7 @@ - (void)setDefaultTimeout:(NSTimeInterval)newDefaultTimeout { dispatch_block_t block = ^{ XMPPLogTrace(); - defaultTimeout = newDefaultTimeout; + self->defaultTimeout = newDefaultTimeout; }; if (dispatch_get_specific(moduleQueueTag)) diff --git a/Extensions/XEP-0012/XMPPLastActivity.m b/Extensions/XEP-0012/XMPPLastActivity.m index a5acb82c45..2dcb0a8c11 100644 --- a/Extensions/XEP-0012/XMPPLastActivity.m +++ b/Extensions/XEP-0012/XMPPLastActivity.m @@ -68,8 +68,8 @@ - (void)deactivate #endif dispatch_block_t block = ^{ @autoreleasepool { - [_queryTracker removeAllIDs]; - _queryTracker = nil; + [self->_queryTracker removeAllIDs]; + self->_queryTracker = nil; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -91,7 +91,7 @@ - (BOOL)respondsToQueries __block BOOL result; dispatch_sync(moduleQueue, ^{ - result = _respondsToQueries; + result = self->_respondsToQueries; }); return result; @@ -101,14 +101,14 @@ - (BOOL)respondsToQueries - (void)setRespondsToQueries:(BOOL)respondsToQueries { dispatch_block_t block = ^{ - if (_respondsToQueries != respondsToQueries) + if (self->_respondsToQueries != respondsToQueries) { - _respondsToQueries = respondsToQueries; + self->_respondsToQueries = respondsToQueries; #ifdef _XMPP_CAPABILITIES_H @autoreleasepool { // Capabilities may have changed, need to notify others - [xmppStream resendMyPresence]; + [self->xmppStream resendMyPresence]; } #endif } @@ -132,7 +132,7 @@ - (NSString *)sendLastActivityQueryToJID:(XMPPJID *)jid withTimeout:(NSTimeInter dispatch_async(moduleQueue, ^{ __weak __typeof__(self) self_weak_ = self; - [_queryTracker addID:queryID block:^(XMPPIQ *iq, id info) { + [self->_queryTracker addID:queryID block:^(XMPPIQ *iq, id info) { __strong __typeof__(self) self = self_weak_; if (iq) { @@ -144,7 +144,7 @@ - (NSString *)sendLastActivityQueryToJID:(XMPPJID *)jid withTimeout:(NSTimeInter } } timeout:timeout]; - [xmppStream sendElement:query]; + [self->xmppStream sendElement:query]; }); return queryID; diff --git a/Extensions/XEP-0016/XMPPPrivacy.m b/Extensions/XEP-0016/XMPPPrivacy.m index 953ad38686..a10096d391 100644 --- a/Extensions/XEP-0016/XMPPPrivacy.m +++ b/Extensions/XEP-0016/XMPPPrivacy.m @@ -124,7 +124,7 @@ - (BOOL)autoRetrievePrivacyListNames __block BOOL result; dispatch_sync(moduleQueue, ^{ - result = autoRetrievePrivacyListNames; + result = self->autoRetrievePrivacyListNames; }); return result; @@ -135,7 +135,7 @@ - (void)setAutoRetrievePrivacyListNames:(BOOL)flag { dispatch_block_t block = ^{ - autoRetrievePrivacyListNames = flag; + self->autoRetrievePrivacyListNames = flag; }; if (dispatch_get_specific(moduleQueueTag)) @@ -155,7 +155,7 @@ - (BOOL)autoRetrievePrivacyListItems __block BOOL result; dispatch_sync(moduleQueue, ^{ - result = autoRetrievePrivacyListItems; + result = self->autoRetrievePrivacyListItems; }); return result; @@ -166,7 +166,7 @@ - (void)setAutoRetrievePrivacyListItems:(BOOL)flag { dispatch_block_t block = ^{ - autoRetrievePrivacyListItems = flag; + self->autoRetrievePrivacyListItems = flag; }; if (dispatch_get_specific(moduleQueueTag)) @@ -186,7 +186,7 @@ - (BOOL)autoClearPrivacyListInfo __block BOOL result; dispatch_sync(moduleQueue, ^{ - result = autoClearPrivacyListInfo; + result = self->autoClearPrivacyListInfo; }); return result; @@ -197,7 +197,7 @@ - (void)setAutoClearPrivacyListInfo:(BOOL)flag { dispatch_block_t block = ^{ - autoClearPrivacyListInfo = flag; + self->autoClearPrivacyListInfo = flag; }; if (dispatch_get_specific(moduleQueueTag)) @@ -268,7 +268,7 @@ - (void)clearPrivacyListInfo { dispatch_async(moduleQueue, ^{ @autoreleasepool { - [privacyDict removeAllObjects]; + [self->privacyDict removeAllObjects]; }}); } } @@ -285,7 +285,7 @@ - (NSArray *)listNames dispatch_sync(moduleQueue, ^{ @autoreleasepool { - result = [[privacyDict allKeys] copy]; + result = [[self->privacyDict allKeys] copy]; }}); return result; @@ -296,7 +296,7 @@ - (NSArray *)listWithName:(NSString *)privacyListName { NSArray* (^block)(void) = ^ NSArray* () { - id result = privacyDict[privacyListName]; + id result = self->privacyDict[privacyListName]; if (result == [NSNull null]) // Not fetched yet return nil; diff --git a/Extensions/XEP-0045/CoreDataStorage/XMPPRoomCoreDataStorage.m b/Extensions/XEP-0045/CoreDataStorage/XMPPRoomCoreDataStorage.m index b69b379fd8..b147bfc592 100644 --- a/Extensions/XEP-0045/CoreDataStorage/XMPPRoomCoreDataStorage.m +++ b/Extensions/XEP-0045/CoreDataStorage/XMPPRoomCoreDataStorage.m @@ -101,7 +101,7 @@ - (NSString *)messageEntityName __block NSString *result = nil; dispatch_block_t block = ^{ - result = messageEntityName; + result = self->messageEntityName; }; if (dispatch_get_specific(storageQueueTag)) @@ -115,7 +115,7 @@ - (NSString *)messageEntityName - (void)setMessageEntityName:(NSString *)newMessageEntityName { dispatch_block_t block = ^{ - messageEntityName = newMessageEntityName; + self->messageEntityName = newMessageEntityName; }; if (dispatch_get_specific(storageQueueTag)) @@ -129,7 +129,7 @@ - (NSString *)occupantEntityName __block NSString *result = nil; dispatch_block_t block = ^{ - result = occupantEntityName; + result = self->occupantEntityName; }; if (dispatch_get_specific(storageQueueTag)) @@ -143,7 +143,7 @@ - (NSString *)occupantEntityName - (void)setOccupantEntityName:(NSString *)newOccupantEntityName { dispatch_block_t block = ^{ - occupantEntityName = newOccupantEntityName; + self->occupantEntityName = newOccupantEntityName; }; if (dispatch_get_specific(storageQueueTag)) @@ -157,7 +157,7 @@ - (NSTimeInterval)maxMessageAge __block NSTimeInterval result = 0; dispatch_block_t block = ^{ - result = maxMessageAge; + result = self->maxMessageAge; }; if (dispatch_get_specific(storageQueueTag)) @@ -172,10 +172,10 @@ - (void)setMaxMessageAge:(NSTimeInterval)age { dispatch_block_t block = ^{ @autoreleasepool { - NSTimeInterval oldMaxMessageAge = maxMessageAge; + NSTimeInterval oldMaxMessageAge = self->maxMessageAge; NSTimeInterval newMaxMessageAge = age; - maxMessageAge = age; + self->maxMessageAge = age; // There are several cases we need to handle here. // @@ -221,7 +221,7 @@ - (void)setMaxMessageAge:(NSTimeInterval)age { [self performDelete]; - if (deleteTimer) + if (self->deleteTimer) [self updateDeleteTimer]; else [self createAndStartDeleteTimer]; @@ -239,7 +239,7 @@ - (NSTimeInterval)deleteInterval __block NSTimeInterval result = 0; dispatch_block_t block = ^{ - result = deleteInterval; + result = self->deleteInterval; }; if (dispatch_get_specific(storageQueueTag)) @@ -254,7 +254,7 @@ - (void)setDeleteInterval:(NSTimeInterval)interval { dispatch_block_t block = ^{ @autoreleasepool { - deleteInterval = interval; + self->deleteInterval = interval; // There are several cases we need to handle here. // @@ -269,9 +269,9 @@ - (void)setDeleteInterval:(NSTimeInterval)interval // 4. If the deleteInterval decreased, then we need to reset the timer so that it fires at an earlier date. // (Plus we might need to do an immediate delete.) - if (deleteInterval > 0.0) + if (self->deleteInterval > 0.0) { - if (deleteTimer == NULL) + if (self->deleteTimer == NULL) { // Handles #2 // @@ -291,7 +291,7 @@ - (void)setDeleteInterval:(NSTimeInterval)interval [self updateDeleteTimer]; } } - else if (deleteTimer) + else if (self->deleteTimer) { // Handles #1 @@ -309,7 +309,7 @@ - (void)pauseOldMessageDeletionForRoom:(XMPPJID *)roomJID { dispatch_block_t block = ^{ @autoreleasepool { - [pausedMessageDeletion addObject:[roomJID bareJID]]; + [self->pausedMessageDeletion addObject:[roomJID bareJID]]; }}; if (dispatch_get_specific(storageQueueTag)) @@ -322,7 +322,7 @@ - (void)resumeOldMessageDeletionForRoom:(XMPPJID *)roomJID { dispatch_block_t block = ^{ @autoreleasepool { - [pausedMessageDeletion removeObject:[roomJID bareJID]]; + [self->pausedMessageDeletion removeObject:[roomJID bareJID]]; [self performDelete]; }}; diff --git a/Extensions/XEP-0045/HybridStorage/XMPPRoomHybridStorage.m b/Extensions/XEP-0045/HybridStorage/XMPPRoomHybridStorage.m index 7e678ae20f..a1b8782d91 100644 --- a/Extensions/XEP-0045/HybridStorage/XMPPRoomHybridStorage.m +++ b/Extensions/XEP-0045/HybridStorage/XMPPRoomHybridStorage.m @@ -122,7 +122,7 @@ - (NSTimeInterval)maxMessageAge __block NSTimeInterval result = 0; dispatch_block_t block = ^{ - result = maxMessageAge; + result = self->maxMessageAge; }; if (dispatch_get_specific(storageQueueTag)) @@ -137,10 +137,10 @@ - (void)setMaxMessageAge:(NSTimeInterval)age { dispatch_block_t block = ^{ @autoreleasepool { - NSTimeInterval oldMaxMessageAge = maxMessageAge; + NSTimeInterval oldMaxMessageAge = self->maxMessageAge; NSTimeInterval newMaxMessageAge = age; - maxMessageAge = age; + self->maxMessageAge = age; // There are several cases we need to handle here. // @@ -186,7 +186,7 @@ - (void)setMaxMessageAge:(NSTimeInterval)age { [self performDelete]; - if (deleteTimer) + if (self->deleteTimer) [self updateDeleteTimer]; else [self createAndStartDeleteTimer]; @@ -204,7 +204,7 @@ - (NSTimeInterval)deleteInterval __block NSTimeInterval result = 0; dispatch_block_t block = ^{ - result = deleteInterval; + result = self->deleteInterval; }; if (dispatch_get_specific(storageQueueTag)) @@ -219,7 +219,7 @@ - (void)setDeleteInterval:(NSTimeInterval)interval { dispatch_block_t block = ^{ @autoreleasepool { - deleteInterval = interval; + self->deleteInterval = interval; // There are several cases we need to handle here. // @@ -234,9 +234,9 @@ - (void)setDeleteInterval:(NSTimeInterval)interval // 4. If the deleteInterval decreased, then we need to reset the timer so that it fires at an earlier date. // (Plus we might need to do an immediate delete.) - if (deleteInterval > 0.0) + if (self->deleteInterval > 0.0) { - if (deleteTimer == NULL) + if (self->deleteTimer == NULL) { // Handles #2 // @@ -256,7 +256,7 @@ - (void)setDeleteInterval:(NSTimeInterval)interval [self updateDeleteTimer]; } } - else if (deleteTimer) + else if (self->deleteTimer) { // Handles #1 @@ -274,7 +274,7 @@ - (void)pauseOldMessageDeletionForRoom:(XMPPJID *)roomJID { dispatch_block_t block = ^{ @autoreleasepool { - [pausedMessageDeletion addObject:[roomJID bareJID]]; + [self->pausedMessageDeletion addObject:[roomJID bareJID]]; }}; if (dispatch_get_specific(storageQueueTag)) @@ -287,7 +287,7 @@ - (void)resumeOldMessageDeletionForRoom:(XMPPJID *)roomJID { dispatch_block_t block = ^{ @autoreleasepool { - [pausedMessageDeletion removeObject:[roomJID bareJID]]; + [self->pausedMessageDeletion removeObject:[roomJID bareJID]]; [self performDelete]; }}; @@ -759,16 +759,16 @@ - (XMPPRoomOccupantHybridMemoryStorageObject *)occupantForJID:(XMPPJID *)occupan { XMPPJID *streamFullJid = [self myJIDForXMPPStream:xmppStream]; - NSDictionary *occupantsRoomsDict = occupantsGlobalDict[streamFullJid]; + NSDictionary *occupantsRoomsDict = self->occupantsGlobalDict[streamFullJid]; NSDictionary *occupantsRoomDict = occupantsRoomsDict[roomJid]; occupant = occupantsRoomDict[occupantJid]; } else { - for (XMPPJID *streamFullJid in occupantsGlobalDict) + for (XMPPJID *streamFullJid in self->occupantsGlobalDict) { - NSDictionary *occupantsRoomsDict = occupantsGlobalDict[streamFullJid]; + NSDictionary *occupantsRoomsDict = self->occupantsGlobalDict[streamFullJid]; NSDictionary *occupantsRoomDict = occupantsRoomsDict[roomJid]; occupant = occupantsRoomDict[occupantJid]; @@ -802,16 +802,16 @@ - (NSArray *)occupantsForRoom:(XMPPJID *)roomJid stream:(XMPPStream *)xmppStream { XMPPJID *streamFullJid = [self myJIDForXMPPStream:xmppStream]; - NSDictionary *occupantsRoomsDict = occupantsGlobalDict[streamFullJid]; + NSDictionary *occupantsRoomsDict = self->occupantsGlobalDict[streamFullJid]; NSDictionary *occupantsRoomDict = occupantsRoomsDict[roomJid]; results = [occupantsRoomDict allValues]; } else { - for (XMPPJID *streamFullJid in occupantsGlobalDict) + for (XMPPJID *streamFullJid in self->occupantsGlobalDict) { - NSDictionary *occupantsRoomsDict = occupantsGlobalDict[streamFullJid]; + NSDictionary *occupantsRoomsDict = self->occupantsGlobalDict[streamFullJid]; NSDictionary *occupantsRoomDict = occupantsRoomsDict[roomJid]; if (occupantsRoomDict) @@ -981,7 +981,7 @@ - (void)handleDidLeaveRoom:(XMPPRoom *)room XMPPJID *streamFullJid = [self myJIDForXMPPStream:xmppStream]; - NSMutableDictionary *occupantsRoomsDict = occupantsGlobalDict[streamFullJid]; + NSMutableDictionary *occupantsRoomsDict = self->occupantsGlobalDict[streamFullJid]; [occupantsRoomsDict removeObjectForKey:roomJid]; // Remove room (and all associated occupants) }]; diff --git a/Extensions/XEP-0045/MemoryStorage/XMPPRoomMemoryStorage.m b/Extensions/XEP-0045/MemoryStorage/XMPPRoomMemoryStorage.m index 0714f25bfb..87a4edfd2b 100644 --- a/Extensions/XEP-0045/MemoryStorage/XMPPRoomMemoryStorage.m +++ b/Extensions/XEP-0045/MemoryStorage/XMPPRoomMemoryStorage.m @@ -455,7 +455,7 @@ - (XMPPRoomOccupantMemoryStorageObject *)occupantForJID:(XMPPJID *)jid dispatch_sync(parentQueue, ^{ @autoreleasepool { - occupant = [occupantsDict[jid] copy]; + occupant = [self->occupantsDict[jid] copy]; }}); return occupant; @@ -482,7 +482,7 @@ - (NSArray *)messages dispatch_sync(parentQueue, ^{ @autoreleasepool { - result = [[NSArray alloc] initWithArray:messages copyItems:YES]; + result = [[NSArray alloc] initWithArray:self->messages copyItems:YES]; }}); return result; @@ -509,7 +509,7 @@ - (NSArray *)occupants dispatch_sync(parentQueue, ^{ @autoreleasepool { - result = [[NSArray alloc] initWithArray:occupantsArray copyItems:YES]; + result = [[NSArray alloc] initWithArray:self->occupantsArray copyItems:YES]; }}); return result; @@ -537,8 +537,8 @@ - (NSArray *)resortMessages dispatch_sync(parentQueue, ^{ @autoreleasepool { - [messages sortUsingSelector:@selector(compare:)]; - result = [[NSArray alloc] initWithArray:messages copyItems:YES]; + [self->messages sortUsingSelector:@selector(compare:)]; + result = [[NSArray alloc] initWithArray:self->messages copyItems:YES]; }}); return result; @@ -566,8 +566,8 @@ - (NSArray *)resortOccupants dispatch_sync(parentQueue, ^{ @autoreleasepool { - [occupantsArray sortUsingSelector:@selector(compare:)]; - result = [[NSArray alloc] initWithArray:occupantsArray copyItems:YES]; + [self->occupantsArray sortUsingSelector:@selector(compare:)]; + result = [[NSArray alloc] initWithArray:self->occupantsArray copyItems:YES]; }}); return result; diff --git a/Extensions/XEP-0045/XMPPMUC.m b/Extensions/XEP-0045/XMPPMUC.m index 46402804ff..3dd2dc543d 100644 --- a/Extensions/XEP-0045/XMPPMUC.m +++ b/Extensions/XEP-0045/XMPPMUC.m @@ -56,8 +56,8 @@ - (void)deactivate XMPPLogTrace(); dispatch_block_t block = ^{ @autoreleasepool { - [xmppIDTracker removeAllIDs]; - xmppIDTracker = nil; + [self->xmppIDTracker removeAllIDs]; + self->xmppIDTracker = nil; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -88,7 +88,7 @@ - (BOOL)isMUCRoomElement:(XMPPElement *)element dispatch_block_t block = ^{ @autoreleasepool { - result = [rooms containsObject:bareFrom]; + result = [self->rooms containsObject:bareFrom]; }}; @@ -129,23 +129,23 @@ - (void)discoverServices // This is a public method, so it may be invoked on any thread/queue. dispatch_block_t block = ^{ @autoreleasepool { - if (hasRequestedServices) return; // We've already requested services + if (self->hasRequestedServices) return; // We've already requested services - NSString *toStr = xmppStream.myJID.domain; + NSString *toStr = self->xmppStream.myJID.domain; NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPDiscoverItemsNamespace]; XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:[XMPPJID jidWithString:toStr] - elementID:[xmppStream generateUUID] + elementID:[self->xmppStream generateUUID] child:query]; - [xmppIDTracker addElement:iq + [self->xmppIDTracker addElement:iq target:self selector:@selector(handleDiscoverServicesQueryIQ:withInfo:) timeout:60]; - [xmppStream sendElement:iq]; - hasRequestedServices = YES; + [self->xmppStream sendElement:iq]; + self->hasRequestedServices = YES; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -176,22 +176,22 @@ - (BOOL)discoverRoomsForServiceNamed:(NSString *)serviceName return NO; dispatch_block_t block = ^{ @autoreleasepool { - if (hasRequestedRooms) return; // We've already requested rooms + if (self->hasRequestedRooms) return; // We've already requested rooms NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPDiscoverItemsNamespace]; XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:[XMPPJID jidWithString:serviceName] - elementID:[xmppStream generateUUID] + elementID:[self->xmppStream generateUUID] child:query]; - [xmppIDTracker addElement:iq + [self->xmppIDTracker addElement:iq target:self selector:@selector(handleDiscoverRoomsQueryIQ:withInfo:) timeout:60]; - [xmppStream sendElement:iq]; - hasRequestedRooms = YES; + [self->xmppStream sendElement:iq]; + self->hasRequestedRooms = YES; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -222,7 +222,7 @@ - (void)handleDiscoverServicesQueryIQ:(XMPPIQ *)iq withInfo:(XMPPBasicTrackingIn withDefaultValue:0] userInfo:dict]; - [multicastDelegate xmppMUCFailedToDiscoverServices:self + [self->multicastDelegate xmppMUCFailedToDiscoverServices:self withError:error]; return; } @@ -231,8 +231,8 @@ - (void)handleDiscoverServicesQueryIQ:(XMPPIQ *)iq withInfo:(XMPPBasicTrackingIn xmlns:XMPPDiscoverItemsNamespace]; NSArray *items = [query elementsForName:@"item"]; - [multicastDelegate xmppMUC:self didDiscoverServices:items]; - hasRequestedServices = NO; // Set this back to NO to allow for future requests + [self->multicastDelegate xmppMUC:self didDiscoverServices:items]; + self->hasRequestedServices = NO; // Set this back to NO to allow for future requests }}; if (dispatch_get_specific(moduleQueueTag)) @@ -257,9 +257,9 @@ - (void)handleDiscoverRoomsQueryIQ:(XMPPIQ *)iq withInfo:(XMPPBasicTrackingInfo code:[errorElem attributeIntegerValueForName:@"code" withDefaultValue:0] userInfo:dict]; - [multicastDelegate xmppMUC:self -failedToDiscoverRoomsForServiceNamed:serviceName - withError:error]; + [self->multicastDelegate xmppMUC:self + failedToDiscoverRoomsForServiceNamed:serviceName + withError:error]; return; } @@ -267,10 +267,10 @@ - (void)handleDiscoverRoomsQueryIQ:(XMPPIQ *)iq withInfo:(XMPPBasicTrackingInfo xmlns:XMPPDiscoverItemsNamespace]; NSArray *items = [query elementsForName:@"item"]; - [multicastDelegate xmppMUC:self + [self->multicastDelegate xmppMUC:self didDiscoverRooms:items forServiceNamed:serviceName]; - hasRequestedRooms = NO; // Set this back to NO to allow for future requests + self->hasRequestedRooms = NO; // Set this back to NO to allow for future requests }}; if (dispatch_get_specific(moduleQueueTag)) @@ -309,7 +309,7 @@ - (void)xmppStream:(XMPPStream *)sender willUnregisterModule:(id)module dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); dispatch_after(popTime, moduleQueue, ^{ @autoreleasepool { - [rooms removeObject:roomJID]; + [self->rooms removeObject:roomJID]; }}); } } diff --git a/Extensions/XEP-0045/XMPPRoom.m b/Extensions/XEP-0045/XMPPRoom.m index f00ea9a2c6..68f0b173a0 100644 --- a/Extensions/XEP-0045/XMPPRoom.m +++ b/Extensions/XEP-0045/XMPPRoom.m @@ -83,8 +83,8 @@ - (void)deactivate [self leaveRoom]; } - [responseTracker removeAllIDs]; - responseTracker = nil; + [self->responseTracker removeAllIDs]; + self->responseTracker = nil; }}; @@ -143,7 +143,7 @@ - (XMPPJID *)myRoomJID __block XMPPJID *result; dispatch_sync(moduleQueue, ^{ - result = myRoomJID; + result = self->myRoomJID; }); return result; @@ -161,7 +161,7 @@ - (NSString *)myNickname __block NSString *result; dispatch_sync(moduleQueue, ^{ - result = myNickname; + result = self->myNickname; }); return result; @@ -179,7 +179,7 @@ - (NSString *)roomSubject __block NSString *result; dispatch_sync(moduleQueue, ^{ - result = roomSubject; + result = self->roomSubject; }); return result; @@ -191,7 +191,7 @@ - (BOOL)isJoined __block BOOL result = 0; dispatch_block_t block = ^{ - result = (state & kXMPPRoomStateJoined) ? YES : NO; + result = (self->state & kXMPPRoomStateJoined) ? YES : NO; }; if (dispatch_get_specific(moduleQueueTag)) @@ -250,7 +250,7 @@ - (void)joinRoomUsingNickname:(NSString *)desiredNickname history:(NSXMLElement { dispatch_block_t block = ^{ @autoreleasepool { - XMPPLogTrace2(@"%@[%@] - %@", THIS_FILE, roomJID, THIS_METHOD); + XMPPLogTrace2(@"%@[%@] - %@", THIS_FILE, self->roomJID, THIS_METHOD); // Check state and update variables @@ -276,12 +276,12 @@ - (void)joinRoomUsingNickname:(NSString *)desiredNickname history:(NSXMLElement [x addChild:[NSXMLElement elementWithName:@"password" stringValue:passwd]]; } - XMPPPresence *presence = [XMPPPresence presenceWithType:nil to:myRoomJID]; + XMPPPresence *presence = [XMPPPresence presenceWithType:nil to:self->myRoomJID]; [presence addChild:x]; - [xmppStream sendElement:presence]; + [self->xmppStream sendElement:presence]; - state |= kXMPPRoomStateJoining; + self->state |= kXMPPRoomStateJoining; }}; @@ -343,14 +343,14 @@ - (void)fetchConfigurationForm // // - NSString *fetchID = [xmppStream generateUUID]; + NSString *fetchID = [self->xmppStream generateUUID]; NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPMUCOwnerNamespace]; - XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:roomJID elementID:fetchID child:query]; + XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:self->roomJID elementID:fetchID child:query]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; - [responseTracker addID:fetchID + [self->responseTracker addID:fetchID target:self selector:@selector(handleConfigurationFormResponse:withInfo:) timeout:60.0]; @@ -412,13 +412,13 @@ - (void)configureRoomUsingOptions:(NSXMLElement *)roomConfigForm NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPMUCOwnerNamespace]; [query addChild:x]; - NSString *iqID = [xmppStream generateUUID]; + NSString *iqID = [self->xmppStream generateUUID]; - XMPPIQ *iq = [XMPPIQ iqWithType:@"set" to:roomJID elementID:iqID child:query]; + XMPPIQ *iq = [XMPPIQ iqWithType:@"set" to:self->roomJID elementID:iqID child:query]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; - [responseTracker addID:iqID + [self->responseTracker addID:iqID target:self selector:@selector(handleConfigureRoomResponse:withInfo:) timeout:60.0]; @@ -442,13 +442,13 @@ - (void)configureRoomUsingOptions:(NSXMLElement *)roomConfigForm NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPMUCOwnerNamespace]; [query addChild:x]; - NSString *iqID = [xmppStream generateUUID]; + NSString *iqID = [self->xmppStream generateUUID]; - XMPPIQ *iq = [XMPPIQ iqWithType:@"set" to:roomJID elementID:iqID child:query]; + XMPPIQ *iq = [XMPPIQ iqWithType:@"set" to:self->roomJID elementID:iqID child:query]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; - [responseTracker addID:iqID + [self->responseTracker addID:iqID target:self selector:@selector(handleConfigureRoomResponse:withInfo:) timeout:60.0]; @@ -520,7 +520,7 @@ - (void)fetchBanList // // - NSString *fetchID = [xmppStream generateUUID]; + NSString *fetchID = [self->xmppStream generateUUID]; NSXMLElement *item = [NSXMLElement elementWithName:@"item"]; [item addAttributeWithName:@"affiliation" stringValue:@"outcast"]; @@ -528,11 +528,11 @@ - (void)fetchBanList NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPMUCAdminNamespace]; [query addChild:item]; - XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:roomJID elementID:fetchID child:query]; + XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:self->roomJID elementID:fetchID child:query]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; - [responseTracker addID:fetchID + [self->responseTracker addID:fetchID target:self selector:@selector(handleFetchBanListResponse:withInfo:) timeout:60.0]; @@ -581,7 +581,7 @@ - (void)fetchMembersList // // - NSString *fetchID = [xmppStream generateUUID]; + NSString *fetchID = [self->xmppStream generateUUID]; NSXMLElement *item = [NSXMLElement elementWithName:@"item"]; [item addAttributeWithName:@"affiliation" stringValue:@"member"]; @@ -589,11 +589,11 @@ - (void)fetchMembersList NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPMUCAdminNamespace]; [query addChild:item]; - XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:roomJID elementID:fetchID child:query]; + XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:self->roomJID elementID:fetchID child:query]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; - [responseTracker addID:fetchID + [self->responseTracker addID:fetchID target:self selector:@selector(handleFetchMembersListResponse:withInfo:) timeout:60.0]; @@ -644,23 +644,23 @@ - (void)fetchAdminsList // // - NSString *fetchID = [xmppStream generateUUID]; - - NSXMLElement *item = [NSXMLElement elementWithName:@"item"]; - [item addAttributeWithName:@"affiliation" stringValue:@"admin"]; - - NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPMUCAdminNamespace]; - [query addChild:item]; - - XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:roomJID elementID:fetchID child:query]; - - [xmppStream sendElement:iq]; - - [responseTracker addID:fetchID - target:self - selector:@selector(handleFetchAdminsListResponse:withInfo:) - timeout:60.0]; - }}; + NSString *fetchID = [self->xmppStream generateUUID]; + + NSXMLElement *item = [NSXMLElement elementWithName:@"item"]; + [item addAttributeWithName:@"affiliation" stringValue:@"admin"]; + + NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPMUCAdminNamespace]; + [query addChild:item]; + + XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:self->roomJID elementID:fetchID child:query]; + + [self->xmppStream sendElement:iq]; + + [self->responseTracker addID:fetchID + target:self + selector:@selector(handleFetchAdminsListResponse:withInfo:) + timeout:60.0]; + }}; if (dispatch_get_specific(moduleQueueTag)) block(); @@ -707,30 +707,28 @@ - (void)fetchOwnersList // // - NSString *fetchID = [xmppStream generateUUID]; - - NSXMLElement *item = [NSXMLElement elementWithName:@"item"]; - [item addAttributeWithName:@"affiliation" stringValue:@"owner"]; - - NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPMUCAdminNamespace]; - [query addChild:item]; - - XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:roomJID elementID:fetchID child:query]; - - [xmppStream sendElement:iq]; - - [responseTracker addID:fetchID - target:self - selector:@selector(handleFetchOwnersListResponse:withInfo:) - timeout:60.0]; + NSString *fetchID = [self->xmppStream generateUUID]; + + NSXMLElement *item = [NSXMLElement elementWithName:@"item"]; + [item addAttributeWithName:@"affiliation" stringValue:@"owner"]; + + NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPMUCAdminNamespace]; + [query addChild:item]; + + XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:self->roomJID elementID:fetchID child:query]; + + [self->xmppStream sendElement:iq]; + + [self->responseTracker addID:fetchID + target:self + selector:@selector(handleFetchOwnersListResponse:withInfo:) + timeout:60.0]; }}; if (dispatch_get_specific(moduleQueueTag)) block(); else dispatch_async(moduleQueue, block); - - } - (void)handleFetchModeratorsListResponse:(XMPPIQ *)iq withInfo:(id )info @@ -768,7 +766,7 @@ - (void)fetchModeratorsList // // - NSString *fetchID = [xmppStream generateUUID]; + NSString *fetchID = [self->xmppStream generateUUID]; NSXMLElement *item = [NSXMLElement elementWithName:@"item"]; [item addAttributeWithName:@"role" stringValue:@"moderator"]; @@ -776,11 +774,11 @@ - (void)fetchModeratorsList NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPMUCAdminNamespace]; [query addChild:item]; - XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:roomJID elementID:fetchID child:query]; + XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:self->roomJID elementID:fetchID child:query]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; - [responseTracker addID:fetchID + [self->responseTracker addID:fetchID target:self selector:@selector(handleFetchModeratorsListResponse:withInfo:) timeout:60.0]; @@ -828,11 +826,11 @@ - (NSString *)editRoomPrivileges:(NSArray *)items [query addChild:item]; } - XMPPIQ *iq = [XMPPIQ iqWithType:@"set" to:roomJID elementID:iqID child:query]; + XMPPIQ *iq = [XMPPIQ iqWithType:@"set" to:self->roomJID elementID:iqID child:query]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; - [responseTracker addID:iqID + [self->responseTracker addID:iqID target:self selector:@selector(handleEditRoomPrivilegesResponse:withInfo:) timeout:60.0]; @@ -860,14 +858,14 @@ - (void)leaveRoom // XMPPPresence *presence = [XMPPPresence presence]; - [presence addAttributeWithName:@"to" stringValue:[myRoomJID full]]; + [presence addAttributeWithName:@"to" stringValue:[self->myRoomJID full]]; [presence addAttributeWithName:@"type" stringValue:@"unavailable"]; - [xmppStream sendElement:presence]; + [self->xmppStream sendElement:presence]; - state &= ~kXMPPRoomStateJoining; - state &= ~kXMPPRoomStateJoined; - state |= kXMPPRoomStateLeaving; + self->state &= ~kXMPPRoomStateJoining; + self->state &= ~kXMPPRoomStateJoined; + self->state |= kXMPPRoomStateLeaving; }}; @@ -908,13 +906,13 @@ - (void)destroyRoom NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPMUCOwnerNamespace]; [query addChild:destroy]; - NSString *iqID = [xmppStream generateUUID]; + NSString *iqID = [self->xmppStream generateUUID]; - XMPPIQ *iq = [XMPPIQ iqWithType:@"set" to:roomJID elementID:iqID child:query]; + XMPPIQ *iq = [XMPPIQ iqWithType:@"set" to:self->roomJID elementID:iqID child:query]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; - [responseTracker addID:iqID + [self->responseTracker addID:iqID target:self selector:@selector(handleDestroyRoomResponse:withInfo:) timeout:60.0]; @@ -965,10 +963,10 @@ - (void)inviteUsers:(NSArray *)jids withMessage:(NSString *)invitatio } XMPPMessage *message = [XMPPMessage message]; - [message addAttributeWithName:@"to" stringValue:[roomJID full]]; + [message addAttributeWithName:@"to" stringValue:[self->roomJID full]]; [message addChild:x]; - [xmppStream sendElement:message]; + [self->xmppStream sendElement:message]; }}; @@ -994,10 +992,10 @@ - (void)sendMessage:(XMPPMessage *)message XMPPLogTrace(); - [message addAttributeWithName:@"to" stringValue:[roomJID full]]; + [message addAttributeWithName:@"to" stringValue:[self->roomJID full]]; [message addAttributeWithName:@"type" stringValue:@"groupchat"]; - [xmppStream sendElement:message]; + [self->xmppStream sendElement:message]; }}; diff --git a/Extensions/XEP-0054/XMPPvCardTempModule.m b/Extensions/XEP-0054/XMPPvCardTempModule.m index 5ef8ba5735..a411db665b 100755 --- a/Extensions/XEP-0054/XMPPvCardTempModule.m +++ b/Extensions/XEP-0054/XMPPvCardTempModule.m @@ -85,8 +85,8 @@ - (void)deactivate dispatch_block_t block = ^{ @autoreleasepool { - [_myvCardTracker removeAllIDs]; - _myvCardTracker = nil; + [self->_myvCardTracker removeAllIDs]; + self->_myvCardTracker = nil; }}; @@ -121,10 +121,10 @@ - (void)fetchvCardTempForJID:(XMPPJID *)jid ignoreStorage:(BOOL)ignoreStorage if (!ignoreStorage) { // Try loading from storage - vCardTemp = [_xmppvCardTempModuleStorage vCardTempForJID:jid xmppStream:xmppStream]; + vCardTemp = [self->_xmppvCardTempModuleStorage vCardTempForJID:jid xmppStream:self->xmppStream]; } - if (vCardTemp == nil && [_xmppvCardTempModuleStorage shouldFetchvCardTempForJID:jid xmppStream:xmppStream]) + if (vCardTemp == nil && [self->_xmppvCardTempModuleStorage shouldFetchvCardTempForJID:jid xmppStream:self->xmppStream]) { [self _fetchvCardTempForJID:jid]; } @@ -143,9 +143,9 @@ - (XMPPvCardTemp *)vCardTempForJID:(XMPPJID *)jid shouldFetch:(BOOL)shouldFetch{ dispatch_block_t block = ^{ @autoreleasepool { - XMPPvCardTemp *vCardTemp = [_xmppvCardTempModuleStorage vCardTempForJID:jid xmppStream:xmppStream]; + XMPPvCardTemp *vCardTemp = [self->_xmppvCardTempModuleStorage vCardTempForJID:jid xmppStream:self->xmppStream]; - if (vCardTemp == nil && shouldFetch && [_xmppvCardTempModuleStorage shouldFetchvCardTempForJID:jid xmppStream:xmppStream]) + if (vCardTemp == nil && shouldFetch && [self->_xmppvCardTempModuleStorage shouldFetchvCardTempForJID:jid xmppStream:self->xmppStream]) { [self _fetchvCardTempForJID:jid]; } @@ -173,15 +173,15 @@ - (void)updateMyvCardTemp:(XMPPvCardTemp *)vCardTemp XMPPvCardTemp *newvCardTemp = [vCardTemp copy]; - XMPPIQ *iq = [XMPPIQ iqWithType:@"set" to:nil elementID:[xmppStream generateUUID] child:newvCardTemp]; - [xmppStream sendElement:iq]; + XMPPIQ *iq = [XMPPIQ iqWithType:@"set" to:nil elementID:[self->xmppStream generateUUID] child:newvCardTemp]; + [self->xmppStream sendElement:iq]; - [_myvCardTracker addElement:iq + [self->_myvCardTracker addElement:iq target:self selector:@selector(handleMyvcard:withInfo:) timeout:600]; - [self _updatevCardTemp:newvCardTemp forJID:[xmppStream myJID]]; + [self _updatevCardTemp:newvCardTemp forJID:[self->xmppStream myJID]]; }}; @@ -205,9 +205,9 @@ - (void)_updatevCardTemp:(XMPPvCardTemp *)vCardTemp forJID:(XMPPJID *)jid XMPPLogVerbose(@"%@: %s %@", THIS_FILE, __PRETTY_FUNCTION__, [jid bare]); - [_xmppvCardTempModuleStorage setvCardTemp:vCardTemp forJID:jid xmppStream:xmppStream]; + [self->_xmppvCardTempModuleStorage setvCardTemp:vCardTemp forJID:jid xmppStream:self->xmppStream]; - [(id )multicastDelegate xmppvCardTempModule:self + [(id )self->multicastDelegate xmppvCardTempModule:self didReceivevCardTemp:vCardTemp forJID:jid]; }}; diff --git a/Extensions/XEP-0060/XMPPPubSub.m b/Extensions/XEP-0060/XMPPPubSub.m index 0be91638ac..ff509b50af 100644 --- a/Extensions/XEP-0060/XMPPPubSub.m +++ b/Extensions/XEP-0060/XMPPPubSub.m @@ -46,7 +46,7 @@ + (BOOL)isPubSubMessage:(XMPPMessage *)message __block NSArray *result; dispatch_block_t block = ^{ - result = pepPublisherJIDs; + result = self->pepPublisherJIDs; }; if (dispatch_get_specific(moduleQueueTag)) @@ -76,7 +76,7 @@ - (void)setPepPublisherJIDs:(NSArray *)pepPublisherJIDs __block NSArray *result; dispatch_block_t block = ^{ - result = pepNodes; + result = self->pepNodes; }; if (dispatch_get_specific(moduleQueueTag)) @@ -174,9 +174,9 @@ - (void)myJIDDidChange:(NSNotification *)notification dispatch_block_t block = ^{ @autoreleasepool { - if (xmppStream == stream) + if (self->xmppStream == stream) { - myJID = xmppStream.myJID; + self->myJID = self->xmppStream.myJID; } }}; @@ -625,7 +625,7 @@ - (NSString *)subscribeToNode:(NSString *)aNode withJID:(XMPPJID *)myBareOrFullJ // Generate uuid and add to dict NSString *uuid = [xmppStream generateUUID]; dispatch_async(moduleQueue, ^{ - subscribeDict[uuid] = node; + self->subscribeDict[uuid] = node; }); // Example from XEP-0060 section 6.1.1: @@ -701,7 +701,7 @@ - (NSString *)unsubscribeFromNode:(NSString *)aNode withJID:(XMPPJID *)myBareOrF // Generate uuid and add to dict NSString *uuid = [xmppStream generateUUID]; dispatch_async(moduleQueue, ^{ - unsubscribeDict[uuid] = node; + self->unsubscribeDict[uuid] = node; }); // Example from XEP-0060 section 6.2.1: @@ -744,9 +744,9 @@ - (NSString *)retrieveSubscriptionsForNode:(NSString *)aNode NSString *uuid = [xmppStream generateUUID]; dispatch_async(moduleQueue, ^{ if (node) - retrieveSubsDict[uuid] = node; + self->retrieveSubsDict[uuid] = node; else - retrieveSubsDict[uuid] = [NSNull null]; + self->retrieveSubsDict[uuid] = [NSNull null]; }); // Get subscriptions for all nodes: @@ -797,7 +797,7 @@ - (NSString *)configureSubscriptionToNode:(NSString *)aNode // Generate uuid and add to dict NSString *uuid = [xmppStream generateUUID]; dispatch_async(moduleQueue, ^{ - configSubDict[uuid] = node; + self->configSubDict[uuid] = node; }); // Example from XEP-0060 section 6.3.5: @@ -862,7 +862,7 @@ - (NSString *)createNode:(NSString *)aNode withOptions:(NSDictionary *)options // Generate uuid and add to dict NSString *uuid = [xmppStream generateUUID]; dispatch_async(moduleQueue, ^{ - createDict[uuid] = node; + self->createDict[uuid] = node; }); // @@ -922,7 +922,7 @@ - (NSString *)deleteNode:(NSString *)aNode // Generate uuid and add to dict NSString *uuid = [xmppStream generateUUID]; dispatch_async(moduleQueue, ^{ - deleteDict[uuid] = node; + self->deleteDict[uuid] = node; }); // Example XEP-0060 section 8.4.1: @@ -961,7 +961,7 @@ - (NSString *)configureNode:(NSString *)aNode withOptions:(NSDictionary *)option // Generate uuid and add to dict NSString *uuid = [xmppStream generateUUID]; dispatch_async(moduleQueue, ^{ - configNodeDict[uuid] = node; + self->configNodeDict[uuid] = node; }); // @@ -1066,7 +1066,7 @@ - (NSString *)publishToNode:(NSString *)node [xmppStream sendElement:iq]; dispatch_async(moduleQueue, ^{ - publishDict[uuid] = node; + self->publishDict[uuid] = node; }); return uuid; } @@ -1115,7 +1115,7 @@ - (NSString *)retrieveItemsFromNode:(NSString *)node withItemIDs:(NSArray *)item [xmppStream sendElement:iq]; dispatch_async(moduleQueue, ^{ - retrieveItemsDict[uuid] = node; + self->retrieveItemsDict[uuid] = node; }); return uuid; } diff --git a/Extensions/XEP-0065/TURNSocket.m b/Extensions/XEP-0065/TURNSocket.m index b5d7bc6b6e..3899d73c9e 100644 --- a/Extensions/XEP-0065/TURNSocket.m +++ b/Extensions/XEP-0065/TURNSocket.m @@ -365,7 +365,7 @@ - (void)startWithDelegate:(id)aDelegate delegateQueue:(dispatch_queue_t)aDelegat dispatch_async(turnQueue, ^{ @autoreleasepool { - if (state != STATE_INIT) + if (self->state != STATE_INIT) { XMPPLogWarn(@"%@: Ignoring start request. Turn procedure already started.", THIS_FILE); return; @@ -374,26 +374,26 @@ - (void)startWithDelegate:(id)aDelegate delegateQueue:(dispatch_queue_t)aDelegat // Set reference to delegate and delegate's queue. // Note that we do NOT retain the delegate. - delegate = aDelegate; - delegateQueue = aDelegateQueue; + self->delegate = aDelegate; + self->delegateQueue = aDelegateQueue; #if !OS_OBJECT_USE_OBJC dispatch_retain(delegateQueue); #endif // Add self as xmpp delegate so we'll get message responses - [xmppStream addDelegate:self delegateQueue:turnQueue]; + [self->xmppStream addDelegate:self delegateQueue:self->turnQueue]; // Start the timer to calculate how long the procedure takes - startTime = [[NSDate alloc] init]; + self->startTime = [[NSDate alloc] init]; // Schedule timer to cancel the turn procedure. // This ensures that, in the event of network error or crash, // the TURNSocket object won't remain in memory forever, and will eventually fail. - turnTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, turnQueue); + self->turnTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, self->turnQueue); - dispatch_source_set_event_handler(turnTimer, ^{ @autoreleasepool { + dispatch_source_set_event_handler(self->turnTimer, ^{ @autoreleasepool { [self doTotalTimeout]; @@ -401,12 +401,12 @@ - (void)startWithDelegate:(id)aDelegate delegateQueue:(dispatch_queue_t)aDelegat dispatch_time_t tt = dispatch_time(DISPATCH_TIME_NOW, (TIMEOUT_TOTAL * NSEC_PER_SEC)); - dispatch_source_set_timer(turnTimer, tt, DISPATCH_TIME_FOREVER, 0.1); - dispatch_resume(turnTimer); + dispatch_source_set_timer(self->turnTimer, tt, DISPATCH_TIME_FOREVER, 0.1); + dispatch_resume(self->turnTimer); // Start the TURN procedure - if (isClient) + if (self->isClient) [self queryProxyCandidates]; else [self targetConnect]; @@ -433,12 +433,12 @@ - (void)abort { dispatch_block_t block = ^{ @autoreleasepool { - if ((state > STATE_INIT) && (state < STATE_DONE)) + if ((self->state > STATE_INIT) && (self->state < STATE_DONE)) { // The only thing we really have to do here is move the state to failure. // This simple act should prevent any further action from being taken in this TUNRSocket object, // since every action is dictated based on the current state. - state = STATE_FAILURE; + self->state = STATE_FAILURE; // And don't forget to cleanup after ourselves [self cleanup]; @@ -1502,9 +1502,9 @@ - (void)succeed dispatch_async(delegateQueue, ^{ @autoreleasepool { - if ([delegate respondsToSelector:@selector(turnSocket:didSucceed:)]) + if ([self->delegate respondsToSelector:@selector(turnSocket:didSucceed:)]) { - [delegate turnSocket:self didSucceed:asyncSocket]; + [self->delegate turnSocket:self didSucceed:self->asyncSocket]; } }}); @@ -1525,9 +1525,9 @@ - (void)fail dispatch_async(delegateQueue, ^{ @autoreleasepool { - if ([delegate respondsToSelector:@selector(turnSocketDidFail:)]) + if ([self->delegate respondsToSelector:@selector(turnSocketDidFail:)]) { - [delegate turnSocketDidFail:self]; + [self->delegate turnSocketDidFail:self]; } }}); diff --git a/Extensions/XEP-0066/XMPPOutOfBandResourceMessaging.m b/Extensions/XEP-0066/XMPPOutOfBandResourceMessaging.m index 91dcc30773..ddcd76b915 100644 --- a/Extensions/XEP-0066/XMPPOutOfBandResourceMessaging.m +++ b/Extensions/XEP-0066/XMPPOutOfBandResourceMessaging.m @@ -19,7 +19,7 @@ @implementation XMPPOutOfBandResourceMessaging { __block NSSet *result; dispatch_block_t block = ^{ - result = _relevantURLSchemes; + result = self->_relevantURLSchemes; }; if (dispatch_get_specific(moduleQueueTag)) @@ -34,7 +34,7 @@ - (void)setRelevantURLSchemes:(NSSet *)relevantURLSchemes { NSSet *newValue = [relevantURLSchemes copy]; dispatch_block_t block = ^{ - _relevantURLSchemes = newValue; + self->_relevantURLSchemes = newValue; }; if (dispatch_get_specific(moduleQueueTag)) diff --git a/Extensions/XEP-0077/XMPPRegistration.m b/Extensions/XEP-0077/XMPPRegistration.m index b1d3bce12d..9367a75a65 100644 --- a/Extensions/XEP-0077/XMPPRegistration.m +++ b/Extensions/XEP-0077/XMPPRegistration.m @@ -50,11 +50,11 @@ - (BOOL)changePassword:(NSString *)newPassword dispatch_block_t block = ^{ @autoreleasepool { - NSString *toStr = xmppStream.myJID.domain; + NSString *toStr = self->xmppStream.myJID.domain; NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:@"jabber:iq:register"]; NSXMLElement *username = [NSXMLElement elementWithName:@"username" - stringValue:xmppStream.myJID.user]; + stringValue:self->xmppStream.myJID.user]; NSXMLElement *password = [NSXMLElement elementWithName:@"password" stringValue:newPassword]; [query addChild:username]; @@ -62,15 +62,15 @@ - (BOOL)changePassword:(NSString *)newPassword XMPPIQ *iq = [XMPPIQ iqWithType:@"set" to:[XMPPJID jidWithString:toStr] - elementID:[xmppStream generateUUID] + elementID:[self->xmppStream generateUUID] child:query]; - [xmppIDTracker addID:[iq elementID] + [self->xmppIDTracker addID:[iq elementID] target:self selector:@selector(handlePasswordChangeQueryIQ:withInfo:) timeout:60]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; } }; @@ -113,15 +113,15 @@ - (BOOL)cancelRegistrationUsingPassword:(NSString *)password NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:@"jabber:iq:register"]; [query addChild:remove]; XMPPIQ *iq = [XMPPIQ iqWithType:@"set" - elementID:[xmppStream generateUUID] + elementID:[self->xmppStream generateUUID] child:query]; - [xmppIDTracker addElement:iq + [self->xmppIDTracker addElement:iq target:self selector:@selector(handleRegistrationCancelQueryIQ:withInfo:) timeout:60]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; } }; @@ -155,7 +155,7 @@ - (void)handlePasswordChangeQueryIQ:(XMPPIQ *)iq withInfo:(XMPPBasicTrackingInfo code:errCode userInfo:errInfo]; - [multicastDelegate passwordChangeFailed:self + [self->multicastDelegate passwordChangeFailed:self withError:err]; return; } @@ -163,11 +163,11 @@ - (void)handlePasswordChangeQueryIQ:(XMPPIQ *)iq withInfo:(XMPPBasicTrackingInfo NSString *type = [iq type]; if ([type isEqualToString:@"result"]) { - [multicastDelegate passwordChangeSuccessful:self]; + [self->multicastDelegate passwordChangeSuccessful:self]; } else { // this should be impossible to reach, but just for safety's sake... - [multicastDelegate passwordChangeFailed:self - withError:nil]; + [self->multicastDelegate passwordChangeFailed:self + withError:nil]; } } }; @@ -196,19 +196,19 @@ - (void)handleRegistrationCancelQueryIQ:(XMPPIQ *)iq withInfo:(XMPPBasicTracking code:errCode userInfo:errInfo]; - [multicastDelegate cancelRegistrationFailed:self - withError:err]; + [self->multicastDelegate cancelRegistrationFailed:self + withError:err]; return; } NSString *type = [iq type]; if ([type isEqualToString:@"result"]) { - [multicastDelegate cancelRegistrationSuccessful:self]; + [self->multicastDelegate cancelRegistrationSuccessful:self]; } else { // this should be impossible to reach, but just for safety's sake... - [multicastDelegate cancelRegistrationFailed:self - withError:nil]; + [self->multicastDelegate cancelRegistrationFailed:self + withError:nil]; } } }; diff --git a/Extensions/XEP-0115/CoreDataStorage/XMPPCapabilitiesCoreDataStorage.m b/Extensions/XEP-0115/CoreDataStorage/XMPPCapabilitiesCoreDataStorage.m index 3ebdd2e448..3b5f5123a1 100644 --- a/Extensions/XEP-0115/CoreDataStorage/XMPPCapabilitiesCoreDataStorage.m +++ b/Extensions/XEP-0115/CoreDataStorage/XMPPCapabilitiesCoreDataStorage.m @@ -476,7 +476,7 @@ - (void)setCapabilities:(NSXMLElement *)capabilities forHash:(NSString *)hash al NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; [fetchRequest setEntity:entity]; [fetchRequest setPredicate:predicate]; - [fetchRequest setFetchBatchSize:saveThreshold]; + [fetchRequest setFetchBatchSize:self->saveThreshold]; NSArray *results = [[self managedObjectContext] executeFetchRequest:fetchRequest error:nil]; @@ -486,7 +486,7 @@ - (void)setCapabilities:(NSXMLElement *)capabilities forHash:(NSString *)hash al { resource.caps = caps; - if (++unsavedCount >= saveThreshold) + if (++unsavedCount >= self->saveThreshold) { [self save]; } diff --git a/Extensions/XEP-0115/XMPPCapabilities.m b/Extensions/XEP-0115/XMPPCapabilities.m index be883d4c0f..6216cff17d 100644 --- a/Extensions/XEP-0115/XMPPCapabilities.m +++ b/Extensions/XEP-0115/XMPPCapabilities.m @@ -162,7 +162,7 @@ - (NSString *)myCapabilitiesNode __block NSString *result; dispatch_sync(moduleQueue, ^{ - result = myCapabilitiesNode; + result = self->myCapabilitiesNode; }); return result; @@ -174,7 +174,7 @@ - (void)setMyCapabilitiesNode:(NSString *)flag NSAssert([flag length], @"myCapabilitiesNode MUST NOT be nil"); dispatch_block_t block = ^{ - myCapabilitiesNode = flag; + self->myCapabilitiesNode = flag; }; if (dispatch_get_specific(moduleQueueTag)) @@ -188,7 +188,7 @@ - (BOOL)autoFetchHashedCapabilities __block BOOL result = NO; dispatch_block_t block = ^{ - result = autoFetchHashedCapabilities; + result = self->autoFetchHashedCapabilities; }; if (dispatch_get_specific(moduleQueueTag)) @@ -202,7 +202,7 @@ - (BOOL)autoFetchHashedCapabilities - (void)setAutoFetchHashedCapabilities:(BOOL)flag { dispatch_block_t block = ^{ - autoFetchHashedCapabilities = flag; + self->autoFetchHashedCapabilities = flag; }; if (dispatch_get_specific(moduleQueueTag)) @@ -216,7 +216,7 @@ - (BOOL)autoFetchNonHashedCapabilities __block BOOL result = NO; dispatch_block_t block = ^{ - result = autoFetchNonHashedCapabilities; + result = self->autoFetchNonHashedCapabilities; }; if (dispatch_get_specific(moduleQueueTag)) @@ -230,7 +230,7 @@ - (BOOL)autoFetchNonHashedCapabilities - (void)setAutoFetchNonHashedCapabilities:(BOOL)flag { dispatch_block_t block = ^{ - autoFetchNonHashedCapabilities = flag; + self->autoFetchNonHashedCapabilities = flag; }; if (dispatch_get_specific(moduleQueueTag)) @@ -244,7 +244,7 @@ - (BOOL)autoFetchMyServerCapabilities __block BOOL result = NO; dispatch_block_t block = ^{ - result = autoFetchMyServerCapabilities; + result = self->autoFetchMyServerCapabilities; }; if (dispatch_get_specific(moduleQueueTag)) @@ -258,7 +258,7 @@ - (BOOL)autoFetchMyServerCapabilities - (void)setAutoFetchMyServerCapabilities:(BOOL)flag { dispatch_block_t block = ^{ - autoFetchMyServerCapabilities = flag; + self->autoFetchMyServerCapabilities = flag; }; if (dispatch_get_specific(moduleQueueTag)) @@ -755,7 +755,7 @@ - (void)collectMyCapabilities }}); } - dispatch_async(moduleQueue, ^{ @autoreleasepool { + dispatch_async(self->moduleQueue, ^{ @autoreleasepool { [self continueCollectMyCapabilities:query]; }}); @@ -860,7 +860,7 @@ - (void)fetchCapabilitiesForJID:(XMPPJID *)jid dispatch_block_t block = ^{ @autoreleasepool { - if ([discoRequestJidSet containsObject:jid]) + if ([self->discoRequestJidSet containsObject:jid]) { // We're already requesting capabilities concerning this JID return; @@ -874,7 +874,7 @@ - (void)fetchCapabilitiesForJID:(XMPPJID *)jid NSString *hash = nil; NSString *hashAlg = nil; - [xmppCapabilitiesStorage getCapabilitiesKnown:&areCapabilitiesKnown + [self->xmppCapabilitiesStorage getCapabilitiesKnown:&areCapabilitiesKnown failed:&haveFailedFetchingBefore node:&node ver:&ver @@ -882,7 +882,7 @@ - (void)fetchCapabilitiesForJID:(XMPPJID *)jid hash:&hash algorithm:&hashAlg forJID:jid - xmppStream:xmppStream]; + xmppStream:self->xmppStream]; if (areCapabilitiesKnown) { @@ -913,7 +913,7 @@ - (void)fetchCapabilitiesForJID:(XMPPJID *)jid // However, there is still a disco request that concerns the jid. key = [self keyFromHash:hash algorithm:hashAlg]; - NSMutableArray *jids = discoRequestHashDict[key]; + NSMutableArray *jids = self->discoRequestHashDict[key]; if (jids) { @@ -921,7 +921,7 @@ - (void)fetchCapabilitiesForJID:(XMPPJID *)jid // That is, there is another JID with the same hash, and we've already sent a disco request to it. [jids addObject:jid]; - [discoRequestJidSet addObject:jid]; + [self->discoRequestJidSet addObject:jid]; return; } @@ -932,12 +932,12 @@ - (void)fetchCapabilitiesForJID:(XMPPJID *)jid NSNumber *requestIndexNum = @1; jids = [@[requestIndexNum, jid] mutableCopy]; - discoRequestHashDict[key] = jids; - [discoRequestJidSet addObject:jid]; + self->discoRequestHashDict[key] = jids; + [self->discoRequestJidSet addObject:jid]; } else { - [discoRequestJidSet addObject:jid]; + [self->discoRequestJidSet addObject:jid]; } // Send disco#info query diff --git a/Extensions/XEP-0136/CoreDataStorage/XMPPMessageArchivingCoreDataStorage.m b/Extensions/XEP-0136/CoreDataStorage/XMPPMessageArchivingCoreDataStorage.m index 794412ede0..d4b801e475 100644 --- a/Extensions/XEP-0136/CoreDataStorage/XMPPMessageArchivingCoreDataStorage.m +++ b/Extensions/XEP-0136/CoreDataStorage/XMPPMessageArchivingCoreDataStorage.m @@ -278,7 +278,7 @@ - (NSString *)messageEntityName __block NSString *result = nil; dispatch_block_t block = ^{ - result = messageEntityName; + result = self->messageEntityName; }; if (dispatch_get_specific(storageQueueTag)) @@ -292,7 +292,7 @@ - (NSString *)messageEntityName - (void)setMessageEntityName:(NSString *)entityName { dispatch_block_t block = ^{ - messageEntityName = entityName; + self->messageEntityName = entityName; }; if (dispatch_get_specific(storageQueueTag)) @@ -306,7 +306,7 @@ - (NSString *)contactEntityName __block NSString *result = nil; dispatch_block_t block = ^{ - result = contactEntityName; + result = self->contactEntityName; }; if (dispatch_get_specific(storageQueueTag)) @@ -320,7 +320,7 @@ - (NSString *)contactEntityName - (void)setContactEntityName:(NSString *)entityName { dispatch_block_t block = ^{ - contactEntityName = entityName; + self->contactEntityName = entityName; }; if (dispatch_get_specific(storageQueueTag)) @@ -347,32 +347,32 @@ - (NSEntityDescription *)contactEntity:(NSManagedObjectContext *)moc - (NSArray *)relevantContentXPaths { - __block NSArray *result; - - dispatch_block_t block = ^{ - result = relevantContentXPaths; - }; - - if (dispatch_get_specific(storageQueueTag)) - block(); - else - dispatch_sync(storageQueue, block); - - return result; + __block NSArray *result; + + dispatch_block_t block = ^{ + result = self->relevantContentXPaths; + }; + + if (dispatch_get_specific(storageQueueTag)) + block(); + else + dispatch_sync(storageQueue, block); + + return result; } - (void)setRelevantContentXPaths:(NSArray *)relevantContentXPathsToSet { - NSArray *newValue = [relevantContentXPathsToSet copy]; - - dispatch_block_t block = ^{ - relevantContentXPaths = newValue; - }; - - if (dispatch_get_specific(storageQueueTag)) - block(); - else - dispatch_async(storageQueue, block); + NSArray *newValue = [relevantContentXPathsToSet copy]; + + dispatch_block_t block = ^{ + self->relevantContentXPaths = newValue; + }; + + if (dispatch_get_specific(storageQueueTag)) + block(); + else + dispatch_async(storageQueue, block); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Extensions/XEP-0136/XMPPMessageArchiving.m b/Extensions/XEP-0136/XMPPMessageArchiving.m index 92bdf932db..1032cbbfe4 100644 --- a/Extensions/XEP-0136/XMPPMessageArchiving.m +++ b/Extensions/XEP-0136/XMPPMessageArchiving.m @@ -109,7 +109,7 @@ - (BOOL)clientSideMessageArchivingOnly __block BOOL result = NO; dispatch_block_t block = ^{ - result = clientSideMessageArchivingOnly; + result = self->clientSideMessageArchivingOnly; }; if (dispatch_get_specific(moduleQueueTag)) @@ -123,7 +123,7 @@ - (BOOL)clientSideMessageArchivingOnly - (void)setClientSideMessageArchivingOnly:(BOOL)flag { dispatch_block_t block = ^{ - clientSideMessageArchivingOnly = flag; + self->clientSideMessageArchivingOnly = flag; }; if (dispatch_get_specific(moduleQueueTag)) @@ -138,7 +138,7 @@ - (NSXMLElement *)preferences dispatch_block_t block = ^{ - result = [preferences copy]; + result = [self->preferences copy]; }; if (dispatch_get_specific(moduleQueueTag)) @@ -155,15 +155,15 @@ - (void)setPreferences:(NSXMLElement *)newPreferences // Update cached value - preferences = [newPreferences copy]; + self->preferences = [newPreferences copy]; // Update storage - if ([xmppMessageArchivingStorage respondsToSelector:@selector(setPreferences:forUser:)]) + if ([self->xmppMessageArchivingStorage respondsToSelector:@selector(setPreferences:forUser:)]) { - XMPPJID *myBareJid = [[xmppStream myJID] bareJID]; + XMPPJID *myBareJid = [[self->xmppStream myJID] bareJID]; - [xmppMessageArchivingStorage setPreferences:preferences forUser:myBareJid]; + [self->xmppMessageArchivingStorage setPreferences:self->preferences forUser:myBareJid]; } // Todo: diff --git a/Extensions/XEP-0147/XMPPURI.m b/Extensions/XEP-0147/XMPPURI.m index 5763b3a0eb..ed2321fd6f 100644 --- a/Extensions/XEP-0147/XMPPURI.m +++ b/Extensions/XEP-0147/XMPPURI.m @@ -86,7 +86,7 @@ - (void) parseURIString:(NSString*)uriString { NSMutableDictionary *queryParameters = [NSMutableDictionary dictionaryWithCapacity:queryKeys.count]; [queryKeys enumerateObjectsUsingBlock:^(NSString *queryItem, NSUInteger idx, BOOL *stop) { if (idx == 0) { - _queryAction = queryItem; + self->_queryAction = queryItem; } else { NSArray *keyValue = [queryItem componentsSeparatedByString:@"="]; if (keyValue.count == 2) { diff --git a/Extensions/XEP-0153/XMPPvCardAvatarModule.m b/Extensions/XEP-0153/XMPPvCardAvatarModule.m index 6444289513..2da5b2b208 100755 --- a/Extensions/XEP-0153/XMPPvCardAvatarModule.m +++ b/Extensions/XEP-0153/XMPPvCardAvatarModule.m @@ -85,7 +85,7 @@ - (BOOL)autoClearMyvcard __block BOOL result = NO; dispatch_block_t block = ^{ - result = _autoClearMyvcard; + result = self->_autoClearMyvcard; }; if (dispatch_get_specific(moduleQueueTag)) @@ -99,7 +99,7 @@ - (BOOL)autoClearMyvcard - (void)setAutoClearMyvcard:(BOOL)flag { dispatch_block_t block = ^{ - _autoClearMyvcard = flag; + self->_autoClearMyvcard = flag; }; if (dispatch_get_specific(moduleQueueTag)) @@ -123,11 +123,11 @@ - (NSData *)photoDataForJID:(XMPPJID *)jid dispatch_block_t block = ^{ @autoreleasepool { - photoData = [_moduleStorage photoDataForJID:jid xmppStream:xmppStream]; + photoData = [self->_moduleStorage photoDataForJID:jid xmppStream:self->xmppStream]; if (photoData == nil) { - [_xmppvCardTempModule vCardTempForJID:jid shouldFetch:YES]; + [self->_xmppvCardTempModule vCardTempForJID:jid shouldFetch:YES]; } }}; diff --git a/Extensions/XEP-0184/XMPPMessageDeliveryReceipts.m b/Extensions/XEP-0184/XMPPMessageDeliveryReceipts.m index 6731d9eeb0..6f469da0e3 100644 --- a/Extensions/XEP-0184/XMPPMessageDeliveryReceipts.m +++ b/Extensions/XEP-0184/XMPPMessageDeliveryReceipts.m @@ -64,7 +64,7 @@ - (BOOL)autoSendMessageDeliveryRequests __block BOOL result = NO; dispatch_block_t block = ^{ - result = autoSendMessageDeliveryRequests; + result = self->autoSendMessageDeliveryRequests; }; if (dispatch_get_specific(moduleQueueTag)) @@ -78,7 +78,7 @@ - (BOOL)autoSendMessageDeliveryRequests - (void)setAutoSendMessageDeliveryRequests:(BOOL)flag { dispatch_block_t block = ^{ - autoSendMessageDeliveryRequests = flag; + self->autoSendMessageDeliveryRequests = flag; }; if (dispatch_get_specific(moduleQueueTag)) @@ -92,7 +92,7 @@ - (BOOL)autoSendMessageDeliveryReceipts __block BOOL result = NO; dispatch_block_t block = ^{ - result = autoSendMessageDeliveryReceipts; + result = self->autoSendMessageDeliveryReceipts; }; if (dispatch_get_specific(moduleQueueTag)) @@ -106,7 +106,7 @@ - (BOOL)autoSendMessageDeliveryReceipts - (void)setAutoSendMessageDeliveryReceipts:(BOOL)flag { dispatch_block_t block = ^{ - autoSendMessageDeliveryReceipts = flag; + self->autoSendMessageDeliveryReceipts = flag; }; if (dispatch_get_specific(moduleQueueTag)) diff --git a/Extensions/XEP-0191/XMPPBlocking.m b/Extensions/XEP-0191/XMPPBlocking.m index e36d0e105d..fa58c5f0ef 100644 --- a/Extensions/XEP-0191/XMPPBlocking.m +++ b/Extensions/XEP-0191/XMPPBlocking.m @@ -122,7 +122,7 @@ - (BOOL)autoRetrieveBlockingListItems __block BOOL result; dispatch_sync(moduleQueue, ^{ - result = autoRetrieveBlockingListItems; + result = self->autoRetrieveBlockingListItems; }); return result; @@ -133,7 +133,7 @@ - (void)setAutoRetrieveBlockingListItems:(BOOL)flag { dispatch_block_t block = ^{ - autoRetrieveBlockingListItems = flag; + self->autoRetrieveBlockingListItems = flag; }; if (dispatch_get_specific(moduleQueueTag)) @@ -153,7 +153,7 @@ - (BOOL)autoClearBlockingListInfo __block BOOL result; dispatch_sync(moduleQueue, ^{ - result = autoClearBlockingListInfo; + result = self->autoClearBlockingListInfo; }); return result; @@ -164,7 +164,7 @@ - (void)setAutoClearBlockingListInfo:(BOOL)flag { dispatch_block_t block = ^{ - autoClearBlockingListInfo = flag; + self->autoClearBlockingListInfo = flag; }; if (dispatch_get_specific(moduleQueueTag)) @@ -208,7 +208,7 @@ - (void)clearBlockingListInfo { dispatch_async(moduleQueue, ^{ @autoreleasepool { - [blockingDict removeAllObjects]; + [self->blockingDict removeAllObjects]; }}); } } @@ -225,7 +225,7 @@ - (NSArray*)blockingList dispatch_sync(moduleQueue, ^{ @autoreleasepool { - result = [[blockingDict allKeys] copy]; + result = [[self->blockingDict allKeys] copy]; }}); return result; diff --git a/Extensions/XEP-0198/Managed Messaging/XMPPManagedMessaging.m b/Extensions/XEP-0198/Managed Messaging/XMPPManagedMessaging.m index c9437662dc..ba0cf9e302 100644 --- a/Extensions/XEP-0198/Managed Messaging/XMPPManagedMessaging.m +++ b/Extensions/XEP-0198/Managed Messaging/XMPPManagedMessaging.m @@ -85,7 +85,7 @@ - (void)xmppStreamDidAuthenticate:(XMPPStream *)sender }]; dispatch_group_notify(stanzaAcknowledgementGroup, self.moduleQueue, ^{ - [multicastDelegate xmppManagedMessagingDidFinishProcessingPreviousStreamConfirmations:self]; + [self->multicastDelegate xmppManagedMessagingDidFinishProcessingPreviousStreamConfirmations:self]; }); } diff --git a/Extensions/XEP-0198/XMPPStreamManagement.m b/Extensions/XEP-0198/XMPPStreamManagement.m index eb25e347a2..bfbd520966 100644 --- a/Extensions/XEP-0198/XMPPStreamManagement.m +++ b/Extensions/XEP-0198/XMPPStreamManagement.m @@ -145,7 +145,7 @@ - (BOOL)autoResume __block BOOL result = NO; dispatch_block_t block = ^{ - result = autoResume; + result = self->autoResume; }; if (dispatch_get_specific(moduleQueueTag)) @@ -161,7 +161,7 @@ - (void)setAutoResume:(BOOL)newAutoResume XMPPLogTrace(); dispatch_block_t block = ^{ - autoResume = newAutoResume; + self->autoResume = newAutoResume; }; if (dispatch_get_specific(moduleQueueTag)) @@ -176,13 +176,13 @@ - (void)automaticallyRequestAcksAfterStanzaCount:(NSUInteger)stanzaCount orTimeo dispatch_block_t block = ^{ @autoreleasepool{ - autoRequest_stanzaCount = stanzaCount; - autoRequest_timeout = MAX(0.0, timeout); + self->autoRequest_stanzaCount = stanzaCount; + self->autoRequest_timeout = MAX(0.0, timeout); - if (autoRequestTimer) { - [autoRequestTimer updateTimeout:autoRequest_timeout fromOriginalStartTime:YES]; + if (self->autoRequestTimer) { + [self->autoRequestTimer updateTimeout:self->autoRequest_timeout fromOriginalStartTime:YES]; } - if (isStarted) { + if (self->isStarted) { [self maybeRequestAck]; } }}; @@ -202,8 +202,8 @@ - (void)getAutomaticallyRequestAcksAfterStanzaCount:(NSUInteger *)stanzaCountPtr dispatch_block_t block = ^{ - stanzaCount = autoRequest_stanzaCount; - timeout = autoRequest_timeout; + stanzaCount = self->autoRequest_stanzaCount; + timeout = self->autoRequest_timeout; }; if (dispatch_get_specific(moduleQueueTag)) @@ -221,13 +221,13 @@ - (void)automaticallySendAcksAfterStanzaCount:(NSUInteger)stanzaCount orTimeout: dispatch_block_t block = ^{ @autoreleasepool{ - autoAck_stanzaCount = stanzaCount; - autoAck_timeout = MAX(0.0, timeout); + self->autoAck_stanzaCount = stanzaCount; + self->autoAck_timeout = MAX(0.0, timeout); - if (autoAckTimer) { - [autoAckTimer updateTimeout:autoAck_timeout fromOriginalStartTime:YES]; + if (self->autoAckTimer) { + [self->autoAckTimer updateTimeout:self->autoAck_timeout fromOriginalStartTime:YES]; } - if (isStarted) { + if (self->isStarted) { [self maybeSendAck]; } }}; @@ -247,8 +247,8 @@ - (void)getAutomaticallySendAcksAfterStanzaCount:(NSUInteger *)stanzaCountPtr or dispatch_block_t block = ^{ - stanzaCount = autoAck_stanzaCount; - timeout = autoAck_timeout; + stanzaCount = self->autoAck_stanzaCount; + timeout = self->autoAck_timeout; }; if (dispatch_get_specific(moduleQueueTag)) @@ -268,7 +268,7 @@ - (NSTimeInterval)ackResponseDelay dispatch_block_t block = ^{ - delay = ackResponseDelay; + delay = self->ackResponseDelay; }; if (dispatch_get_specific(moduleQueueTag)) @@ -285,7 +285,7 @@ - (void)setAckResponseDelay:(NSTimeInterval)delay dispatch_block_t block = ^{ - ackResponseDelay = delay; + self->ackResponseDelay = delay; }; if (dispatch_get_specific(moduleQueueTag)) @@ -325,12 +325,12 @@ - (void)enableStreamManagementWithResumption:(BOOL)supportsResumption maxTimeout { dispatch_block_t block = ^{ @autoreleasepool{ - if (isStarted) + if (self->isStarted) { XMPPLogWarn(@"Stream management is already enabled/resumed."); return; } - if (enableQueued || enableSent) + if (self->enableQueued || self->enableSent) { XMPPLogWarn(@"Stream management is already started (pending response from server)."); return; @@ -338,16 +338,16 @@ - (void)enableStreamManagementWithResumption:(BOOL)supportsResumption maxTimeout // State transition cleanup - [unackedByServer removeAllObjects]; - unackedByServer_lastRequestOffset = 0; + [self->unackedByServer removeAllObjects]; + self->unackedByServer_lastRequestOffset = 0; - [unackedByClient removeAllObjects]; - unackedByClient_lastAckOffset = 0; + [self->unackedByClient removeAllObjects]; + self->unackedByClient_lastAckOffset = 0; - unprocessedReceivedAcks = nil; + self->unprocessedReceivedAcks = nil; - pendingHandledStanzaIds = nil; - outstandingStanzaIds = 0; + self->pendingHandledStanzaIds = nil; + self->outstandingStanzaIds = 0; // Send enable stanza: // @@ -362,10 +362,10 @@ - (void)enableStreamManagementWithResumption:(BOOL)supportsResumption maxTimeout [enable addAttributeWithName:@"max" stringValue:[NSString stringWithFormat:@"%.0f", maxTimeout]]; } - [xmppStream sendElement:enable]; + [self->xmppStream sendElement:enable]; - enableQueued = YES; - requestedMax = (maxTimeout > 0.0) ? (uint32_t)maxTimeout : (uint32_t)0; + self->enableQueued = YES; + self->requestedMax = (maxTimeout > 0.0) ? (uint32_t)maxTimeout : (uint32_t)0; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -426,7 +426,7 @@ - (BOOL)canResumeStream dispatch_block_t block = ^{ @autoreleasepool{ - if (isStarted || enableQueued || enableSent) { + if (self->isStarted || self->enableQueued || self->enableSent) { return_from_block; } @@ -434,10 +434,10 @@ - (BOOL)canResumeStream uint32_t timeout = 0; NSDate *lastDisconnect = nil; - [storage getResumptionId:&resumptionId - timeout:&timeout - lastDisconnect:&lastDisconnect - forStream:xmppStream]; + [self->storage getResumptionId:&resumptionId + timeout:&timeout + lastDisconnect:&lastDisconnect + forStream:self->xmppStream]; result = [self canResumeStreamWithResumptionId:resumptionId timeout:timeout lastDisconnect:lastDisconnect]; }}; @@ -461,16 +461,16 @@ - (void)sendResumeRequestWithResumptionId:(NSString *)resumptionId // State transition cleanup - [unackedByServer removeAllObjects]; - unackedByServer_lastRequestOffset = 0; + [self->unackedByServer removeAllObjects]; + self->unackedByServer_lastRequestOffset = 0; - [unackedByClient removeAllObjects]; - unackedByClient_lastAckOffset = 0; + [self->unackedByClient removeAllObjects]; + self->unackedByClient_lastAckOffset = 0; - unprocessedReceivedAcks = nil; + self->unprocessedReceivedAcks = nil; - pendingHandledStanzaIds = nil; - outstandingStanzaIds = 0; + self->pendingHandledStanzaIds = nil; + self->outstandingStanzaIds = 0; // Restore our state from the last stream @@ -478,20 +478,20 @@ - (void)sendResumeRequestWithResumptionId:(NSString *)resumptionId uint32_t newLastHandledByServer = 0; NSArray *pendingOutgoingStanzas = nil; - [storage getLastHandledByClient:&newLastHandledByClient - lastHandledByServer:&newLastHandledByServer - pendingOutgoingStanzas:&pendingOutgoingStanzas - forStream:xmppStream]; + [self->storage getLastHandledByClient:&newLastHandledByClient + lastHandledByServer:&newLastHandledByServer + pendingOutgoingStanzas:&pendingOutgoingStanzas + forStream:self->xmppStream]; - lastHandledByClient = newLastHandledByClient; - lastHandledByServer = newLastHandledByServer; + self->lastHandledByClient = newLastHandledByClient; + self->lastHandledByServer = newLastHandledByServer; if ([pendingOutgoingStanzas count] > 0) { - prev_unackedByServer = [[NSMutableArray alloc] initWithArray:pendingOutgoingStanzas copyItems:YES]; + self->prev_unackedByServer = [[NSMutableArray alloc] initWithArray:pendingOutgoingStanzas copyItems:YES]; } XMPPLogVerbose(@"%@: Attempting to resume: lastHandledByClient(%u) lastHandledByServer(%u)", - THIS_FILE, lastHandledByClient, lastHandledByServer); + THIS_FILE, self->lastHandledByClient, self->lastHandledByServer); // Send the resume stanza: // @@ -499,11 +499,11 @@ - (void)sendResumeRequestWithResumptionId:(NSString *)resumptionId NSXMLElement *resume = [NSXMLElement elementWithName:@"resume" xmlns:XMLNS_STREAM_MANAGEMENT]; [resume addAttributeWithName:@"previd" stringValue:resumptionId]; - [resume addAttributeWithName:@"h" stringValue:[NSString stringWithFormat:@"%u", lastHandledByClient]]; + [resume addAttributeWithName:@"h" stringValue:[NSString stringWithFormat:@"%u", self->lastHandledByClient]]; - [xmppStream sendBindElement:resume]; + [self->xmppStream sendBindElement:resume]; - didAttemptResume = YES; + self->didAttemptResume = YES; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -521,61 +521,61 @@ - (void)processResumed:(NSXMLElement *)resumed dispatch_block_t block = ^{ @autoreleasepool { - uint32_t h = [resumed attributeUInt32ValueForName:@"h" withDefaultValue:lastHandledByServer]; + uint32_t h = [resumed attributeUInt32ValueForName:@"h" withDefaultValue:self->lastHandledByServer]; uint32_t diff; - if (h >= lastHandledByServer) - diff = h - lastHandledByServer; + if (h >= self->lastHandledByServer) + diff = h - self->lastHandledByServer; else - diff = (UINT32_MAX - lastHandledByServer) + h; + diff = (UINT32_MAX - self->lastHandledByServer) + h; // IMPORTATNT: // This code path uses prev_unackedByServer (NOT unackedByServer). // This is because the ack has to do with stanzas sent from the previous connection. - if (diff > [prev_unackedByServer count]) + if (diff > [self->prev_unackedByServer count]) { XMPPLogWarn(@"Unexpected h value from resume: lastH=%lu, newH=%lu, numPendingStanzas=%lu", - (unsigned long)lastHandledByServer, - (unsigned long)h, - (unsigned long)[prev_unackedByServer count]); + (unsigned long)self->lastHandledByServer, + (unsigned long)h, + (unsigned long)[self->prev_unackedByServer count]); - diff = (uint32_t)[prev_unackedByServer count]; + diff = (uint32_t)[self->prev_unackedByServer count]; } NSMutableArray *stanzaIds = [NSMutableArray arrayWithCapacity:(NSUInteger)diff]; for (uint32_t i = 0; i < diff; i++) { - XMPPStreamManagementOutgoingStanza *outgoingStanza = prev_unackedByServer[(NSUInteger) i]; + XMPPStreamManagementOutgoingStanza *outgoingStanza = self->prev_unackedByServer[(NSUInteger) i]; if (outgoingStanza.stanzaId) { [stanzaIds addObject:outgoingStanza.stanzaId]; } } - lastHandledByServer = h; + self->lastHandledByServer = h; - XMPPLogVerbose(@"%@: processResumed: lastHandledByServer(%u)", THIS_FILE, lastHandledByServer); + XMPPLogVerbose(@"%@: processResumed: lastHandledByServer(%u)", THIS_FILE, self->lastHandledByServer); - isStarted = YES; - didResume = YES; + self->isStarted = YES; + self->didResume = YES; - prev_unackedByServer = nil; + self->prev_unackedByServer = nil; - resume_response = resumed; - resume_stanzaIds = [stanzaIds copy]; + self->resume_response = resumed; + self->resume_stanzaIds = [stanzaIds copy]; // Update storage - [storage setLastDisconnect:[NSDate date] - lastHandledByServer:lastHandledByServer - pendingOutgoingStanzas:nil - forStream:xmppStream]; + [self->storage setLastDisconnect:[NSDate date] + lastHandledByServer:self->lastHandledByServer + pendingOutgoingStanzas:nil + forStream:self->xmppStream]; // Notify delegate - [multicastDelegate xmppStreamManagement:self didReceiveAckForStanzaIds:stanzaIds]; + [self->multicastDelegate xmppStreamManagement:self didReceiveAckForStanzaIds:stanzaIds]; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -598,7 +598,7 @@ - (BOOL)didResume __block BOOL result = NO; dispatch_block_t block = ^{ - result = didResume; + result = self->didResume; }; if (dispatch_get_specific(moduleQueueTag)) @@ -641,9 +641,9 @@ - (BOOL)didResumeWithAckedStanzaIds:(NSArray * _Nullable * _Nullable)stanzaI dispatch_block_t block = ^{ - result = didResume; - stanzaIds = resume_stanzaIds; - response = resume_response; + result = self->didResume; + stanzaIds = self->resume_stanzaIds; + response = self->resume_response; }; if (dispatch_get_specific(moduleQueueTag)) @@ -733,10 +733,10 @@ - (XMPPBindResult)handleBind:(NSXMLElement *)element withError:(NSError **)errPt dispatch_async(moduleQueue, ^{ @autoreleasepool { - didResume = NO; - resume_response = element; + self->didResume = NO; + self->resume_response = element; - prev_unackedByServer = nil; + self->prev_unackedByServer = nil; }}); return XMPPBindResultFailFallback; @@ -787,7 +787,7 @@ - (void)requestAck dispatch_block_t block = ^{ @autoreleasepool{ - if (isStarted || enableQueued || enableSent) + if (self->isStarted || self->enableQueued || self->enableSent) { [self _requestAck]; } @@ -920,7 +920,7 @@ - (void)processSentElement:(XMPPElement *)element stanzaId = [element elementID]; } - dispatch_async(moduleQueue, ^{ @autoreleasepool{ + dispatch_async(self->moduleQueue, ^{ @autoreleasepool{ // Set the stanzaId. stanza.stanzaId = stanzaId; @@ -933,13 +933,13 @@ - (void)processSentElement:(XMPPElement *)element BOOL dequeuedPendingAck = NO; - while ([unprocessedReceivedAcks count] > 0) + while ([self->unprocessedReceivedAcks count] > 0) { - NSXMLElement *ack = unprocessedReceivedAcks[0]; + NSXMLElement *ack = self->unprocessedReceivedAcks[0]; if ([self processReceivedAck:ack]) { - [unprocessedReceivedAcks removeObjectAtIndex:0]; + [self->unprocessedReceivedAcks removeObjectAtIndex:0]; dequeuedPendingAck = YES; } else @@ -1115,7 +1115,7 @@ - (void)sendAck dispatch_block_t block = ^{ @autoreleasepool{ - if (isStarted) + if (self->isStarted) { [self _sendAck]; } @@ -1328,7 +1328,7 @@ - (void)markHandledStanzaId:(id)stanzaId BOOL found = NO; - for (XMPPStreamManagementIncomingStanza *stanza in unackedByClient) + for (XMPPStreamManagementIncomingStanza *stanza in self->unackedByClient) { if (stanza.isHandled) { @@ -1360,12 +1360,12 @@ - (void)markHandledStanzaId:(id)stanzaId // to actually "handle" the element. So we have this odd edge case, // which we handle by queuing up the stanzaId for later processing. - if (outstandingStanzaIds > 0) + if (self->outstandingStanzaIds > 0) { - if (pendingHandledStanzaIds == nil) - pendingHandledStanzaIds = [[NSMutableArray alloc] init]; + if (self->pendingHandledStanzaIds == nil) + self->pendingHandledStanzaIds = [[NSMutableArray alloc] init]; - [pendingHandledStanzaIds addObject:stanzaId]; + [self->pendingHandledStanzaIds addObject:stanzaId]; } } }}; @@ -1442,7 +1442,7 @@ - (void)processReceivedElement:(XMPPElement *)element }}); } - dispatch_async(moduleQueue, ^{ @autoreleasepool + dispatch_async(self->moduleQueue, ^{ @autoreleasepool { if (isHandled) { @@ -1454,14 +1454,14 @@ - (void)processReceivedElement:(XMPPElement *)element // Check for edge case: // - stanzaId was marked as handled before we figured out what the stanzaId was - if ([pendingHandledStanzaIds count] > 0) + if ([self->pendingHandledStanzaIds count] > 0) { NSUInteger i = 0; - for (id pendingStanzaId in pendingHandledStanzaIds) + for (id pendingStanzaId in self->pendingHandledStanzaIds) { if ([pendingStanzaId isEqual:stanzaId]) { - [pendingHandledStanzaIds removeObjectAtIndex:i]; + [self->pendingHandledStanzaIds removeObjectAtIndex:i]; stanza.isHandled = YES; break; @@ -1474,8 +1474,8 @@ - (void)processReceivedElement:(XMPPElement *)element // Defensive programming. // Don't let this array grow infinitely big (if markHandledStanzaId is being invoked incorrectly). - if (--outstandingStanzaIds == 0) { - [pendingHandledStanzaIds removeAllObjects]; + if (--self->outstandingStanzaIds == 0) { + [self->pendingHandledStanzaIds removeAllObjects]; } if (stanza.isHandled) diff --git a/Extensions/XEP-0199/XMPPAutoPing.m b/Extensions/XEP-0199/XMPPAutoPing.m index 593615816a..4d3820e4f2 100644 --- a/Extensions/XEP-0199/XMPPAutoPing.m +++ b/Extensions/XEP-0199/XMPPAutoPing.m @@ -65,10 +65,10 @@ - (void)deactivate [self stopPingIntervalTimer]; - lastReceiveTime = 0; - awaitingPingResponse = NO; + self->lastReceiveTime = 0; + self->awaitingPingResponse = NO; - [xmppPing deactivate]; + [self->xmppPing deactivate]; [super deactivate]; }}; @@ -103,7 +103,7 @@ - (NSTimeInterval)pingInterval __block NSTimeInterval result; dispatch_sync(moduleQueue, ^{ - result = pingInterval; + result = self->pingInterval; }); return result; } @@ -113,19 +113,19 @@ - (void)setPingInterval:(NSTimeInterval)interval { dispatch_block_t block = ^{ - if (pingInterval != interval) + if (self->pingInterval != interval) { - pingInterval = interval; + self->pingInterval = interval; // Update the pingTimer. // // Depending on new value and current state of the pingTimer, // this may mean starting, stoping, or simply updating the timer. - if (pingInterval > 0) + if (self->pingInterval > 0) { // Remember: Only start the pinger after the xmpp stream is up and authenticated - if ([xmppStream isAuthenticated]) + if ([self->xmppStream isAuthenticated]) [self startPingIntervalTimer]; } else @@ -152,7 +152,7 @@ - (NSTimeInterval)pingTimeout __block NSTimeInterval result; dispatch_sync(moduleQueue, ^{ - result = pingTimeout; + result = self->pingTimeout; }); return result; } @@ -162,9 +162,9 @@ - (void)setPingTimeout:(NSTimeInterval)timeout { dispatch_block_t block = ^{ - if (pingTimeout != timeout) + if (self->pingTimeout != timeout) { - pingTimeout = timeout; + self->pingTimeout = timeout; } }; @@ -185,7 +185,7 @@ - (XMPPJID *)targetJID __block XMPPJID *result; dispatch_sync(moduleQueue, ^{ - result = targetJID; + result = self->targetJID; }); return result; } @@ -195,11 +195,11 @@ - (void)setTargetJID:(XMPPJID *)jid { dispatch_block_t block = ^{ - if (![targetJID isEqualToJID:jid]) + if (![self->targetJID isEqualToJID:jid]) { - targetJID = jid; + self->targetJID = jid; - targetJIDStr = [targetJID full]; + self->targetJIDStr = [self->targetJID full]; } }; @@ -220,7 +220,7 @@ - (NSTimeInterval)lastReceiveTime __block NSTimeInterval result; dispatch_sync(moduleQueue, ^{ - result = lastReceiveTime; + result = self->lastReceiveTime; }); return result; } diff --git a/Extensions/XEP-0199/XMPPPing.m b/Extensions/XEP-0199/XMPPPing.m index e733ab73d7..73c21e68a0 100644 --- a/Extensions/XEP-0199/XMPPPing.m +++ b/Extensions/XEP-0199/XMPPPing.m @@ -68,8 +68,8 @@ - (void)deactivate dispatch_block_t block = ^{ @autoreleasepool { - [pingTracker removeAllIDs]; - pingTracker = nil; + [self->pingTracker removeAllIDs]; + self->pingTracker = nil; }}; @@ -93,7 +93,7 @@ - (BOOL)respondsToQueries __block BOOL result; dispatch_sync(moduleQueue, ^{ - result = respondsToQueries; + result = self->respondsToQueries; }); return result; } @@ -103,14 +103,14 @@ - (void)setRespondsToQueries:(BOOL)flag { dispatch_block_t block = ^{ - if (respondsToQueries != flag) + if (self->respondsToQueries != flag) { - respondsToQueries = flag; + self->respondsToQueries = flag; #ifdef _XMPP_CAPABILITIES_H @autoreleasepool { // Capabilities may have changed, need to notify others. - [xmppStream resendMyPresence]; + [self->xmppStream resendMyPresence]; } #endif } @@ -137,7 +137,7 @@ - (NSString *)generatePingIDWithTimeout:(NSTimeInterval)timeout selector:@selector(handlePong:withInfo:) timeout:timeout]; - [pingTracker addID:pingID trackingInfo:pingInfo]; + [self->pingTracker addID:pingID trackingInfo:pingInfo]; }}); diff --git a/Extensions/XEP-0202/XMPPAutoTime.m b/Extensions/XEP-0202/XMPPAutoTime.m index 86037d6772..e6bb648c70 100644 --- a/Extensions/XEP-0202/XMPPAutoTime.m +++ b/Extensions/XEP-0202/XMPPAutoTime.m @@ -70,8 +70,8 @@ - (void)deactivate [self stopRecalibrationTimer]; - [xmppTime deactivate]; - awaitingQueryResponse = NO; + [self->xmppTime deactivate]; + self->awaitingQueryResponse = NO; [[NSNotificationCenter defaultCenter] removeObserver:self]; @@ -110,7 +110,7 @@ - (NSTimeInterval)recalibrationInterval __block NSTimeInterval result; dispatch_sync(moduleQueue, ^{ - result = recalibrationInterval; + result = self->recalibrationInterval; }); return result; } @@ -120,19 +120,19 @@ - (void)setRecalibrationInterval:(NSTimeInterval)interval { dispatch_block_t block = ^{ - if (recalibrationInterval != interval) + if (self->recalibrationInterval != interval) { - recalibrationInterval = interval; + self->recalibrationInterval = interval; // Update the recalibrationTimer. // // Depending on new value and current state of the recalibrationTimer, // this may mean starting, stoping, or simply updating the timer. - if (recalibrationInterval > 0) + if (self->recalibrationInterval > 0) { // Remember: Only start the timer after the xmpp stream is up and authenticated - if ([xmppStream isAuthenticated]) + if ([self->xmppStream isAuthenticated]) [self startRecalibrationTimer]; } else @@ -159,7 +159,7 @@ - (XMPPJID *)targetJID __block XMPPJID *result; dispatch_sync(moduleQueue, ^{ - result = targetJID; + result = self->targetJID; }); return result; } @@ -169,9 +169,9 @@ - (void)setTargetJID:(XMPPJID *)jid { dispatch_block_t block = ^{ - if (![targetJID isEqualToJID:jid]) + if (![self->targetJID isEqualToJID:jid]) { - targetJID = jid; + self->targetJID = jid; } }; @@ -192,7 +192,7 @@ - (NSTimeInterval)timeDifference __block NSTimeInterval result; dispatch_sync(moduleQueue, ^{ - result = timeDifference; + result = self->timeDifference; }); return result; @@ -210,7 +210,7 @@ - (NSDate *)date __block NSDate *result; dispatch_sync(moduleQueue, ^{ - result = [[NSDate date] dateByAddingTimeInterval:-timeDifference]; + result = [[NSDate date] dateByAddingTimeInterval:-self->timeDifference]; }); return result; @@ -228,7 +228,7 @@ - (dispatch_time_t)lastCalibrationTime __block dispatch_time_t result; dispatch_sync(moduleQueue, ^{ - result = lastCalibrationTime; + result = self->lastCalibrationTime; }); return result; @@ -276,10 +276,10 @@ - (void)systemClockDidChange:(NSNotification *)notification // Calculate system clock change - NSDate *oldSysTime = systemUptimeChecked; + NSDate *oldSysTime = self->systemUptimeChecked; NSDate *newSysTime = now; - NSTimeInterval oldSysUptime = systemUptime; + NSTimeInterval oldSysUptime = self->systemUptime; NSTimeInterval newSysUptime = sysUptime; NSTimeInterval sysTimeDiff = [newSysTime timeIntervalSinceDate:oldSysTime]; @@ -289,13 +289,13 @@ - (void)systemClockDidChange:(NSNotification *)notification // Modify timeDifference & notify delegate - timeDifference += sysClockChange; - [multicastDelegate xmppAutoTime:self didUpdateTimeDifference:timeDifference]; + self->timeDifference += sysClockChange; + [self->multicastDelegate xmppAutoTime:self didUpdateTimeDifference:self->timeDifference]; // Dont forget to update our variables self.systemUptimeChecked = now; - systemUptime = sysUptime; + self->systemUptime = sysUptime; }}); } diff --git a/Extensions/XEP-0202/XMPPTime.m b/Extensions/XEP-0202/XMPPTime.m index 3e09cd5b6f..96cefbb1a9 100644 --- a/Extensions/XEP-0202/XMPPTime.m +++ b/Extensions/XEP-0202/XMPPTime.m @@ -68,8 +68,8 @@ - (void)deactivate dispatch_block_t block = ^{ @autoreleasepool { - [queryTracker removeAllIDs]; - queryTracker = nil; + [self->queryTracker removeAllIDs]; + self->queryTracker = nil; }}; @@ -93,7 +93,7 @@ - (BOOL)respondsToQueries __block BOOL result; dispatch_sync(moduleQueue, ^{ - result = respondsToQueries; + result = self->respondsToQueries; }); return result; } @@ -103,14 +103,14 @@ - (void)setRespondsToQueries:(BOOL)flag { dispatch_block_t block = ^{ - if (respondsToQueries != flag) + if (self->respondsToQueries != flag) { - respondsToQueries = flag; + self->respondsToQueries = flag; #ifdef _XMPP_CAPABILITIES_H @autoreleasepool { // Capabilities may have changed, need to notify others. - [xmppStream resendMyPresence]; + [self->xmppStream resendMyPresence]; } #endif } @@ -138,7 +138,7 @@ - (NSString *)generateQueryIDWithTimeout:(NSTimeInterval)timeout selector:@selector(handleResponse:withInfo:) timeout:timeout]; - [queryTracker addID:queryID trackingInfo:queryInfo]; + [self->queryTracker addID:queryID trackingInfo:queryInfo]; }}); diff --git a/Extensions/XEP-0224/XMPPAttentionModule.m b/Extensions/XEP-0224/XMPPAttentionModule.m index cfea00e96b..a31f3e6a3b 100644 --- a/Extensions/XEP-0224/XMPPAttentionModule.m +++ b/Extensions/XEP-0224/XMPPAttentionModule.m @@ -55,7 +55,7 @@ - (BOOL)respondsToQueries __block BOOL result; dispatch_sync(moduleQueue, ^{ - result = respondsToQueries; + result = self->respondsToQueries; }); return result; } @@ -65,14 +65,14 @@ - (void)setRespondsToQueries:(BOOL)flag { dispatch_block_t block = ^{ - if (respondsToQueries != flag) + if (self->respondsToQueries != flag) { - respondsToQueries = flag; + self->respondsToQueries = flag; #ifdef _XMPP_CAPABILITIES_H @autoreleasepool { // Capabilities may have changed, need to notify others. - [xmppStream resendMyPresence]; + [self->xmppStream resendMyPresence]; } #endif } diff --git a/Extensions/XEP-0280/XMPPMessageCarbons.m b/Extensions/XEP-0280/XMPPMessageCarbons.m index 280196ee90..c592f1376a 100644 --- a/Extensions/XEP-0280/XMPPMessageCarbons.m +++ b/Extensions/XEP-0280/XMPPMessageCarbons.m @@ -62,11 +62,11 @@ - (BOOL)activate:(XMPPStream *)aXmppStream - (void)deactivate { XMPPLogTrace(); - + dispatch_block_t block = ^{ @autoreleasepool { - [xmppIDTracker removeAllIDs]; - xmppIDTracker = nil; + [self->xmppIDTracker removeAllIDs]; + self->xmppIDTracker = nil; }}; @@ -87,7 +87,7 @@ - (BOOL)autoEnableMessageCarbons __block BOOL result = NO; dispatch_block_t block = ^{ - result = autoEnableMessageCarbons; + result = self->autoEnableMessageCarbons; }; if (dispatch_get_specific(moduleQueueTag)) @@ -101,7 +101,7 @@ - (BOOL)autoEnableMessageCarbons - (void)setAutoEnableMessageCarbons:(BOOL)flag { dispatch_block_t block = ^{ - autoEnableMessageCarbons = flag; + self->autoEnableMessageCarbons = flag; }; if (dispatch_get_specific(moduleQueueTag)) @@ -115,7 +115,7 @@ - (BOOL)isMessageCarbonsEnabled __block BOOL result = NO; dispatch_block_t block = ^{ - result = messageCarbonsEnabled; + result = self->messageCarbonsEnabled; }; if (dispatch_get_specific(moduleQueueTag)) @@ -131,7 +131,7 @@ - (BOOL)allowsUntrustedMessageCarbons __block BOOL result = NO; dispatch_block_t block = ^{ - result = allowsUntrustedMessageCarbons; + result = self->allowsUntrustedMessageCarbons; }; if (dispatch_get_specific(moduleQueueTag)) @@ -145,7 +145,7 @@ - (BOOL)allowsUntrustedMessageCarbons - (void)setAllowsUntrustedMessageCarbons:(BOOL)flag { dispatch_block_t block = ^{ - allowsUntrustedMessageCarbons = flag; + self->allowsUntrustedMessageCarbons = flag; }; if (dispatch_get_specific(moduleQueueTag)) @@ -158,7 +158,7 @@ - (void)enableMessageCarbons { dispatch_block_t block = ^{ - if(!messageCarbonsEnabled && [xmppIDTracker numberOfIDs] == 0) + if(!self->messageCarbonsEnabled && [self->xmppIDTracker numberOfIDs] == 0) { NSString *elementID = [XMPPStream generateUUID]; XMPPIQ *iq = [XMPPIQ iqWithType:@"set" elementID:elementID]; @@ -167,12 +167,12 @@ - (void)enableMessageCarbons NSXMLElement *enable = [NSXMLElement elementWithName:@"enable" xmlns:XMLNS_XMPP_MESSAGE_CARBONS]; [iq addChild:enable]; - [xmppIDTracker addElement:iq - target:self - selector:@selector(enableMessageCarbonsIQ:withInfo:) - timeout:XMPPIDTrackerTimeoutNone]; + [self->xmppIDTracker addElement:iq + target:self + selector:@selector(enableMessageCarbonsIQ:withInfo:) + timeout:XMPPIDTrackerTimeoutNone]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; } }; @@ -186,7 +186,7 @@ - (void)disableMessageCarbons { dispatch_block_t block = ^{ - if(messageCarbonsEnabled && [xmppIDTracker numberOfIDs] == 0) + if(self->messageCarbonsEnabled && [self->xmppIDTracker numberOfIDs] == 0) { NSString *elementID = [XMPPStream generateUUID]; @@ -196,12 +196,12 @@ - (void)disableMessageCarbons NSXMLElement *enable = [NSXMLElement elementWithName:@"disable" xmlns:XMLNS_XMPP_MESSAGE_CARBONS]; [iq addChild:enable]; - [xmppIDTracker addElement:iq - target:self - selector:@selector(disableMessageCarbonsIQ:withInfo:) - timeout:XMPPIDTrackerTimeoutNone]; + [self->xmppIDTracker addElement:iq + target:self + selector:@selector(disableMessageCarbonsIQ:withInfo:) + timeout:XMPPIDTrackerTimeoutNone]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; } }; diff --git a/Extensions/XEP-0313/XMPPMessageArchiveManagement.m b/Extensions/XEP-0313/XMPPMessageArchiveManagement.m index b578ef344c..fcf5bf12c5 100644 --- a/Extensions/XEP-0313/XMPPMessageArchiveManagement.m +++ b/Extensions/XEP-0313/XMPPMessageArchiveManagement.m @@ -46,7 +46,7 @@ - (NSInteger)resultAutomaticPagingPageSize { __block NSInteger result = NO; [self performBlock:^{ - result = _resultAutomaticPagingPageSize; + result = self->_resultAutomaticPagingPageSize; }]; return result; } @@ -54,7 +54,7 @@ - (NSInteger)resultAutomaticPagingPageSize - (void)setResultAutomaticPagingPageSize:(NSInteger)resultAutomaticPagingPageSize { [self performBlockAsync:^{ - _resultAutomaticPagingPageSize = resultAutomaticPagingPageSize; + self->_resultAutomaticPagingPageSize = resultAutomaticPagingPageSize; }]; } @@ -84,7 +84,7 @@ - (void)retrieveMessageArchiveAt:(XMPPJID *)archiveJID withFormElement:(NSXMLEle } NSString *queryId = [XMPPStream generateUUID]; - [_outstandingQueryIds addObject:queryId]; + [self->_outstandingQueryIds addObject:queryId]; NSXMLElement *queryElement = [NSXMLElement elementWithName:@"query" xmlns:XMLNS_XMPP_MAM]; [queryElement addAttributeWithName:QueryIdAttributeName stringValue:queryId]; @@ -101,7 +101,7 @@ - (void)retrieveMessageArchiveAt:(XMPPJID *)archiveJID withFormElement:(NSXMLEle selector:@selector(handleMessageArchiveIQ:withInfo:) timeout:60]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; }]; } @@ -166,7 +166,7 @@ - (void)retrieveFormFields { selector:@selector(handleFormFieldsIQ:withInfo:) timeout:60]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; }]; } @@ -190,7 +190,7 @@ - (BOOL)activate:(XMPPStream *)aXmppStream { - (void)deactivate { [self performBlock:^{ @autoreleasepool { [self.xmppIDTracker removeAllIDs]; - _xmppIDTracker = nil; + self->_xmppIDTracker = nil; }}]; [super deactivate]; } diff --git a/Extensions/XEP-0357/XMPPPushModule.m b/Extensions/XEP-0357/XMPPPushModule.m index fe3dd2a74c..f3df4e0617 100644 --- a/Extensions/XEP-0357/XMPPPushModule.m +++ b/Extensions/XEP-0357/XMPPPushModule.m @@ -81,7 +81,7 @@ - (void) registerForPushWithOptions:(XMPPPushOptions*)options [weakMulticast pushModule:strongSelf didRegisterWithResponseIq:responseIq outgoingIq:enableElement]; } timeout:30]; [self setRegistrationStatus:XMPPPushStatusRegistering forServerJID:options.serverJID]; - [xmppStream sendElement:enableElement]; + [self->xmppStream sendElement:enableElement]; }]; } @@ -107,7 +107,7 @@ - (void) disablePushForServerJID:(XMPPJID*)serverJID [strongSelf setRegistrationStatus:XMPPPushStatusNotRegistered forServerJID:serverJID]; [weakMulticast pushModule:strongSelf disabledPushForServerJID:serverJID node:node responseIq:responseIq outgoingIq:disableElement]; } timeout:30]; - [xmppStream sendElement:disableElement]; + [self->xmppStream sendElement:disableElement]; }]; } @@ -118,12 +118,12 @@ - (BOOL)activate:(XMPPStream *)aXmppStream if ([super activate:aXmppStream]) { [self performBlock:^{ - _registrationStatus = [NSMutableDictionary dictionary]; - _capabilitiesModules = [NSMutableSet set]; - [xmppStream autoAddDelegate:self delegateQueue:moduleQueue toModulesOfClass:[XMPPCapabilities class]]; - _tracker = [[XMPPIDTracker alloc] initWithStream:aXmppStream dispatchQueue:moduleQueue]; + self->_registrationStatus = [NSMutableDictionary dictionary]; + self->_capabilitiesModules = [NSMutableSet set]; + [self->xmppStream autoAddDelegate:self delegateQueue:self->moduleQueue toModulesOfClass:[XMPPCapabilities class]]; + self->_tracker = [[XMPPIDTracker alloc] initWithStream:aXmppStream dispatchQueue:self->moduleQueue]; - [xmppStream enumerateModulesWithBlock:^(XMPPModule *module, NSUInteger idx, BOOL *stop) { + [self->xmppStream enumerateModulesWithBlock:^(XMPPModule *module, NSUInteger idx, BOOL *stop) { if ([module isKindOfClass:[XMPPCapabilities class]]) { [self.capabilitiesModules addObject:(XMPPCapabilities*)module]; } @@ -137,11 +137,11 @@ - (BOOL)activate:(XMPPStream *)aXmppStream - (void) deactivate { [self performBlock:^{ - [_tracker removeAllIDs]; - _tracker = nil; - [xmppStream removeAutoDelegate:self delegateQueue:moduleQueue fromModulesOfClass:[XMPPCapabilities class]]; - _capabilitiesModules = nil; - _registrationStatus = nil; + [self->_tracker removeAllIDs]; + self->_tracker = nil; + [self->xmppStream removeAutoDelegate:self delegateQueue:self->moduleQueue fromModulesOfClass:[XMPPCapabilities class]]; + self->_capabilitiesModules = nil; + self->_registrationStatus = nil; }]; [super deactivate]; } @@ -150,20 +150,20 @@ - (void) deactivate { - (void) refresh { [self performBlockAsync:^{ - if (xmppStream.state != STATE_XMPP_CONNECTED) { + if (self->xmppStream.state != STATE_XMPP_CONNECTED) { XMPPLogError(@"XMPPPushModule: refresh error - not connected. %@", self); return; } [self.registrationStatus removeAllObjects]; - XMPPJID *jid = xmppStream.myJID.bareJID; + XMPPJID *jid = self->xmppStream.myJID.bareJID; if (!jid) { return; } __block BOOL supportsPush = NO; __block NSXMLElement *capabilities = nil; [self.capabilitiesModules enumerateObjectsUsingBlock:^(XMPPCapabilities * _Nonnull capsModule, BOOL * _Nonnull stop) { id storage = capsModule.xmppCapabilitiesStorage; - BOOL fetched = [storage areCapabilitiesKnownForJID:jid xmppStream:xmppStream]; + BOOL fetched = [storage areCapabilitiesKnownForJID:jid xmppStream:self->xmppStream]; if (fetched) { - capabilities = [storage capabilitiesForJID:jid xmppStream:xmppStream]; + capabilities = [storage capabilitiesForJID:jid xmppStream:self->xmppStream]; if (capabilities) { supportsPush = [self supportsPushFromCaps:capabilities]; *stop = YES; @@ -173,7 +173,7 @@ - (void) refresh { } }]; if (supportsPush) { - [multicastDelegate pushModule:self readyWithCapabilities:capabilities jid:jid]; + [self->multicastDelegate pushModule:self readyWithCapabilities:capabilities jid:jid]; } }]; } diff --git a/Extensions/XEP-0359/XMPPStanzaIdModule.m b/Extensions/XEP-0359/XMPPStanzaIdModule.m index a198a42765..78ca71e714 100644 --- a/Extensions/XEP-0359/XMPPStanzaIdModule.m +++ b/Extensions/XEP-0359/XMPPStanzaIdModule.m @@ -29,14 +29,14 @@ - (instancetype) initWithDispatchQueue:(dispatch_queue_t)queue { - (void) setAutoAddOriginId:(BOOL)autoAddOriginId { [self performBlockAsync:^{ - _autoAddOriginId = autoAddOriginId; + self->_autoAddOriginId = autoAddOriginId; }]; } - (BOOL) autoAddOriginId { __block BOOL autoAddOriginId = NO; [self performBlock:^{ - autoAddOriginId = _autoAddOriginId; + autoAddOriginId = self->_autoAddOriginId; }]; return autoAddOriginId; } @@ -44,27 +44,27 @@ - (BOOL) autoAddOriginId { - (BOOL) copyElementIdIfPresent { __block BOOL copyElementIdIfPresent = NO; [self performBlock:^{ - copyElementIdIfPresent = _copyElementIdIfPresent; + copyElementIdIfPresent = self->_copyElementIdIfPresent; }]; return copyElementIdIfPresent; } - (void) setCopyElementIdIfPresent:(BOOL)copyElementIdIfPresent { [self performBlockAsync:^{ - _copyElementIdIfPresent = copyElementIdIfPresent; + self->_copyElementIdIfPresent = copyElementIdIfPresent; }]; } - (void) setFilterBlock:(BOOL (^)(XMPPStream *stream, XMPPMessage* message))filterBlock { [self performBlockAsync:^{ - _filterBlock = [filterBlock copy]; + self->_filterBlock = [filterBlock copy]; }]; } - (BOOL (^)(XMPPStream *stream, XMPPMessage* message))filterBlock { __block BOOL (^filterBlock)(XMPPStream *stream, XMPPMessage* message) = nil; [self performBlock:^{ - filterBlock = _filterBlock; + filterBlock = self->_filterBlock; }]; return filterBlock; } @@ -114,7 +114,7 @@ - (nullable XMPPMessage *)xmppStream:(XMPPStream *)sender willSendMessage:(XMPPM [message addOriginId:originId]; [self performBlockAsync:^{ - [multicastDelegate stanzaIdModule:self didAddOriginId:originId toMessage:message]; + [self->multicastDelegate stanzaIdModule:self didAddOriginId:originId toMessage:message]; }]; return message; diff --git a/Extensions/XEP-0363/XMPPHTTPFileUpload.m b/Extensions/XEP-0363/XMPPHTTPFileUpload.m index 69295beddd..6c82170e72 100644 --- a/Extensions/XEP-0363/XMPPHTTPFileUpload.m +++ b/Extensions/XEP-0363/XMPPHTTPFileUpload.m @@ -59,7 +59,7 @@ - (void)deactivate { dispatch_block_t block = ^{ @autoreleasepool { [self.responseTracker removeAllIDs]; - _responseTracker = nil; + self->_responseTracker = nil; }}; @@ -178,7 +178,7 @@ - (void)requestSlotFromService:(XMPPJID*)serviceJID }); } timeout:60.0]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; }}; if (dispatch_get_specific(moduleQueueTag)) diff --git a/Extensions/XMPPMUCLight/CoreDataStorage/XMPPRoomLightCoreDataStorage.m b/Extensions/XMPPMUCLight/CoreDataStorage/XMPPRoomLightCoreDataStorage.m index ea6a3fa42c..0a7eff984c 100644 --- a/Extensions/XMPPMUCLight/CoreDataStorage/XMPPRoomLightCoreDataStorage.m +++ b/Extensions/XMPPMUCLight/CoreDataStorage/XMPPRoomLightCoreDataStorage.m @@ -108,7 +108,7 @@ - (NSString *)messageEntityName{ __block NSString *result = nil; dispatch_block_t block = ^{ - result = messageEntityName; + result = self->messageEntityName; }; if (dispatch_get_specific(storageQueueTag)) diff --git a/Extensions/XMPPMUCLight/XMPPMUCLight.m b/Extensions/XMPPMUCLight/XMPPMUCLight.m index 4e8a05df87..4cde2669b0 100644 --- a/Extensions/XMPPMUCLight/XMPPMUCLight.m +++ b/Extensions/XMPPMUCLight/XMPPMUCLight.m @@ -48,8 +48,8 @@ - (BOOL)activate:(XMPPStream *)aXmppStream { - (void)deactivate { dispatch_block_t block = ^{ @autoreleasepool { - [xmppIDTracker removeAllIDs]; - xmppIDTracker = nil; + [self->xmppIDTracker removeAllIDs]; + self->xmppIDTracker = nil; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -77,15 +77,15 @@ - (BOOL)discoverRoomsForServiceNamed:(nonnull NSString *)serviceName { xmlns:XMPPMUCLightDiscoItemsNamespace]; XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:[XMPPJID jidWithString:serviceName] - elementID:[xmppStream generateUUID] + elementID:[self->xmppStream generateUUID] child:query]; - [xmppIDTracker addElement:iq + [self->xmppIDTracker addElement:iq target:self selector:@selector(handleDiscoverRoomsQueryIQ:withInfo:) timeout:60]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -109,7 +109,7 @@ - (void)handleDiscoverRoomsQueryIQ:(XMPPIQ *)iq withInfo:(XMPPBasicTrackingInfo code:errorCode userInfo:dict]; - [multicastDelegate xmppMUCLight:self failedToDiscoverRoomsForServiceNamed:serviceName withError:error]; + [self->multicastDelegate xmppMUCLight:self failedToDiscoverRoomsForServiceNamed:serviceName withError:error]; return; } @@ -118,7 +118,7 @@ - (void)handleDiscoverRoomsQueryIQ:(XMPPIQ *)iq withInfo:(XMPPBasicTrackingInfo NSArray *items = [query elementsForName:@"item"]; - [multicastDelegate xmppMUCLight:self didDiscoverRooms:items forServiceNamed:serviceName]; + [self->multicastDelegate xmppMUCLight:self didDiscoverRooms:items forServiceNamed:serviceName]; }}; @@ -142,15 +142,15 @@ - (BOOL)requestBlockingList:(nonnull NSString *)serviceName{ xmlns:XMPPMUCLightBlocking]; XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:[XMPPJID jidWithString:serviceName] - elementID:[xmppStream generateUUID] + elementID:[self->xmppStream generateUUID] child:query]; - [xmppIDTracker addElement:iq + [self->xmppIDTracker addElement:iq target:self selector:@selector(handleRequestBlockingList:withInfo:) timeout:60]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -194,15 +194,15 @@ - (BOOL)performActionOnElements:(nonnull NSArray *)elements forS XMPPIQ *iq = [XMPPIQ iqWithType:@"set" to:[XMPPJID jidWithString:serviceName] - elementID:[xmppStream generateUUID] + elementID:[self->xmppStream generateUUID] child:query]; - [xmppIDTracker addElement:iq + [self->xmppIDTracker addElement:iq target:self selector:@selector(handlePerformAction:withInfo:) timeout:60]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -255,7 +255,7 @@ - (void)xmppStream:(XMPPStream *)sender didRegisterModule:(id)module { XMPPJID *roomJID = [(XMPPRoomLight *)module roomJID]; - [rooms addObject:roomJID]; + [self->rooms addObject:roomJID]; } }}; @@ -279,8 +279,8 @@ - (void)xmppStream:(XMPPStream *)sender willUnregisterModule:(id)module { double delayInSeconds = [self delayInSeconds]; dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); - dispatch_after(popTime, moduleQueue, ^{ @autoreleasepool { - [rooms removeObject:roomJID]; + dispatch_after(popTime, self->moduleQueue, ^{ @autoreleasepool { + [self->rooms removeObject:roomJID]; }}); } }}; diff --git a/Extensions/XMPPMUCLight/XMPPRoomLight.m b/Extensions/XMPPMUCLight/XMPPRoomLight.m index ab9183bf4d..2bed21a9e8 100644 --- a/Extensions/XMPPMUCLight/XMPPRoomLight.m +++ b/Extensions/XMPPMUCLight/XMPPRoomLight.m @@ -67,8 +67,8 @@ - (BOOL)activate:(XMPPStream *)aXmppStream - (void)deactivate { dispatch_block_t block = ^{ @autoreleasepool { - [responseTracker removeAllIDs]; - responseTracker = nil; + [self->responseTracker removeAllIDs]; + self->responseTracker = nil; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -83,7 +83,7 @@ - (BOOL)shouldStoreAffiliationChangeMessages { __block BOOL result; dispatch_block_t block = ^{ @autoreleasepool { - result = shouldStoreAffiliationChangeMessages; + result = self->shouldStoreAffiliationChangeMessages; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -97,7 +97,7 @@ - (BOOL)shouldStoreAffiliationChangeMessages - (void)setShouldStoreAffiliationChangeMessages:(BOOL)newValue { dispatch_block_t block = ^{ @autoreleasepool { - shouldStoreAffiliationChangeMessages = newValue; + self->shouldStoreAffiliationChangeMessages = newValue; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -110,7 +110,7 @@ - (BOOL)shouldHandleMemberMessagesWithoutBody { __block BOOL result; dispatch_block_t block = ^{ @autoreleasepool { - result = shouldHandleMemberMessagesWithoutBody; + result = self->shouldHandleMemberMessagesWithoutBody; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -124,7 +124,7 @@ - (BOOL)shouldHandleMemberMessagesWithoutBody - (void)setShouldHandleMemberMessagesWithoutBody:(BOOL)newValue { dispatch_block_t block = ^{ @autoreleasepool { - shouldHandleMemberMessagesWithoutBody = newValue; + self->shouldHandleMemberMessagesWithoutBody = newValue; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -148,7 +148,7 @@ - (nonnull NSString *)subject { - (NSArray *)knownMembersList { __block NSArray *result; dispatch_block_t block = ^{ @autoreleasepool { - result = knownMembersList; + result = self->knownMembersList; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -183,7 +183,7 @@ - (void)handleConfigElements:(NSArray *)configElements{ - (void)setRoomname:(NSString *)aRoomname{ dispatch_block_t block = ^{ @autoreleasepool { - roomname = aRoomname; + self->roomname = aRoomname; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -194,7 +194,7 @@ - (void)setRoomname:(NSString *)aRoomname{ - (void)setSubject:(NSString *)aSubject{ dispatch_block_t block = ^{ @autoreleasepool { - subject = aSubject; + self->subject = aSubject; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -205,7 +205,7 @@ - (void)setSubject:(NSString *)aSubject{ - (void)setKnownMembersList:(NSArray *)aMembersList { dispatch_block_t block = ^{ @autoreleasepool { - knownMembersList = [aMembersList copy]; + self->knownMembersList = [aMembersList copy]; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -216,7 +216,7 @@ - (void)setKnownMembersList:(NSArray *)aMembersList { - (void)setMemberListVersion:(NSString *)aVersion{ dispatch_block_t block = ^{ @autoreleasepool { - memberListVersion = aVersion; + self->memberListVersion = aVersion; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -227,7 +227,7 @@ - (void)setMemberListVersion:(NSString *)aVersion{ - (void)setConfigVersion:(NSString *)aVersion{ dispatch_block_t block = ^{ @autoreleasepool { - configVersion = aVersion; + self->configVersion = aVersion; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -259,9 +259,9 @@ - (void)createRoomLightWithMembersJID:(nullable NSArray *) members{ // dispatch_block_t block = ^{ @autoreleasepool { - _roomJID = [XMPPJID jidWithUser:[XMPPStream generateUUID] - domain:self.domain - resource:nil]; + self->_roomJID = [XMPPJID jidWithUser:[XMPPStream generateUUID] + domain:self.domain + resource:nil]; NSString *iqID = [XMPPStream generateUUID]; NSXMLElement *iq = [NSXMLElement elementWithName:@"iq"]; @@ -271,7 +271,7 @@ - (void)createRoomLightWithMembersJID:(nullable NSArray *) members{ NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:@"urn:xmpp:muclight:0#create"]; NSXMLElement *configuration = [NSXMLElement elementWithName:@"configuration"]; - [configuration addChild:[NSXMLElement elementWithName:@"roomname" stringValue:roomname]]; + [configuration addChild:[NSXMLElement elementWithName:@"roomname" stringValue:self->roomname]]; NSXMLElement *occupants = [NSXMLElement elementWithName:@"occupants"]; for (XMPPJID *jid in members){ @@ -285,12 +285,12 @@ - (void)createRoomLightWithMembersJID:(nullable NSArray *) members{ [iq addChild:query]; - [responseTracker addID:iqID - target:self - selector:@selector(handleCreateRoomLight:withInfo:) - timeout:60.0]; + [self->responseTracker addID:iqID + target:self + selector:@selector(handleCreateRoomLight:withInfo:) + timeout:60.0]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -329,17 +329,17 @@ - (void)leaveRoomLight{ NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPRoomLightAffiliations]; NSXMLElement *user = [NSXMLElement elementWithName:@"user"]; [user addAttributeWithName:@"affiliation" stringValue:@"none"]; - user.stringValue = xmppStream.myJID.bare; + user.stringValue = self->xmppStream.myJID.bare; [query addChild:user]; [iq addChild:query]; - [responseTracker addID:iqID + [self->responseTracker addID:iqID target:self selector:@selector(handleLeaveRoomLight:withInfo:) timeout:60.0]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -385,11 +385,11 @@ - (void)addUsers:(nonnull NSArray *)users{ } [iq addChild:query]; - [responseTracker addID:iqID - target:self - selector:@selector(handleAddUsers:withInfo:) - timeout:60.0]; - [xmppStream sendElement:iq]; + [self->responseTracker addID:iqID + target:self + selector:@selector(handleAddUsers:withInfo:) + timeout:60.0]; + [self->xmppStream sendElement:iq]; }}; @@ -420,18 +420,18 @@ - (void)fetchMembersList{ // NSString *iqID = [XMPPStream generateUUID]; - XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:_roomJID elementID:iqID]; + XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:self->_roomJID elementID:iqID]; NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPRoomLightAffiliations]; [query addChild:[NSXMLElement elementWithName:@"version" stringValue:self.memberListVersion]]; [iq addChild:query]; - [responseTracker addID:iqID - target:self - selector:@selector(handleFetchMembersListResponse:withInfo:) - timeout:60.0]; + [self->responseTracker addID:iqID + target:self + selector:@selector(handleFetchMembersListResponse:withInfo:) + timeout:60.0]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -472,16 +472,16 @@ - (void)destroyRoom { // NSString *iqID = [XMPPStream generateUUID]; - XMPPIQ *iq = [XMPPIQ iqWithType:@"set" to:_roomJID elementID:iqID]; + XMPPIQ *iq = [XMPPIQ iqWithType:@"set" to:self->_roomJID elementID:iqID]; NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPRoomLightDestroy]; [iq addChild:query]; - [responseTracker addID:iqID - target:self - selector:@selector(handleDestroyRoom:withInfo:) - timeout:60.0]; + [self->responseTracker addID:iqID + target:self + selector:@selector(handleDestroyRoom:withInfo:) + timeout:60.0]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -502,10 +502,10 @@ - (void)sendMessage:(nonnull XMPPMessage *)message{ dispatch_block_t block = ^{ @autoreleasepool { - [message addAttributeWithName:@"to" stringValue:[_roomJID full]]; + [message addAttributeWithName:@"to" stringValue:[self->_roomJID full]]; [message addAttributeWithName:@"type" stringValue:@"groupchat"]; - [xmppStream sendElement:message]; + [self->xmppStream sendElement:message]; }}; @@ -547,7 +547,7 @@ - (void)changeAffiliations:(nonnull NSArray *)members{ // NSString *iqID = [XMPPStream generateUUID]; - XMPPIQ *iq = [XMPPIQ iqWithType:@"set" to:_roomJID elementID:iqID]; + XMPPIQ *iq = [XMPPIQ iqWithType:@"set" to:self->_roomJID elementID:iqID]; NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPRoomLightAffiliations]; for (NSXMLElement *element in members){ @@ -556,12 +556,12 @@ - (void)changeAffiliations:(nonnull NSArray *)members{ [iq addChild:query]; - [responseTracker addID:iqID - target:self - selector:@selector(handleChangeAffiliations:withInfo:) - timeout:60.0]; + [self->responseTracker addID:iqID + target:self + selector:@selector(handleChangeAffiliations:withInfo:) + timeout:60.0]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -591,18 +591,18 @@ - (void)getConfiguration { // NSString *iqID = [XMPPStream generateUUID]; - XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:_roomJID elementID:iqID]; + XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:self->_roomJID elementID:iqID]; NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPRoomLightConfiguration]; [query addChild:[NSXMLElement elementWithName:@"version" stringValue:self.configVersion]]; [iq addChild:query]; - [responseTracker addID:iqID - target:self - selector:@selector(handleGetConfiguration:withInfo:) - timeout:60.0]; + [self->responseTracker addID:iqID + target:self + selector:@selector(handleGetConfiguration:withInfo:) + timeout:60.0]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; }}; if (dispatch_get_specific(moduleQueueTag)) @@ -640,7 +640,7 @@ - (void)setConfiguration:(nonnull NSArray *)configs{ // NSString *iqID = [XMPPStream generateUUID]; - XMPPIQ *iq = [XMPPIQ iqWithType:@"set" to:_roomJID elementID:iqID]; + XMPPIQ *iq = [XMPPIQ iqWithType:@"set" to:self->_roomJID elementID:iqID]; NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPRoomLightConfiguration]; for (NSXMLElement *element in configs){ @@ -649,12 +649,12 @@ - (void)setConfiguration:(nonnull NSArray *)configs{ [iq addChild:query]; - [responseTracker addID:iqID - target:self - selector:@selector(handleSetConfiguration:withInfo:) - timeout:60.0]; + [self->responseTracker addID:iqID + target:self + selector:@selector(handleSetConfiguration:withInfo:) + timeout:60.0]; - [xmppStream sendElement:iq]; + [self->xmppStream sendElement:iq]; }}; if (dispatch_get_specific(moduleQueueTag)) diff --git a/Utilities/XMPPSRVResolver.m b/Utilities/XMPPSRVResolver.m index e04dd54113..e7ebc743d8 100644 --- a/Utilities/XMPPSRVResolver.m +++ b/Utilities/XMPPSRVResolver.m @@ -137,7 +137,7 @@ - (NSString *)srvName __block NSString *result = nil; dispatch_block_t block = ^{ - result = [srvName copy]; + result = [self->srvName copy]; }; if (dispatch_get_specific(resolverQueueTag)) @@ -153,7 +153,7 @@ - (NSTimeInterval)timeout __block NSTimeInterval result = 0.0; dispatch_block_t block = ^{ - result = timeout; + result = self->timeout; }; if (dispatch_get_specific(resolverQueueTag)) @@ -484,7 +484,7 @@ - (void)startWithSRVName:(NSString *)aSRVName timeout:(NSTimeInterval)aTimeout { dispatch_block_t block = ^{ @autoreleasepool { - if (resolveInProgress) + if (self->resolveInProgress) { return; } @@ -493,13 +493,13 @@ - (void)startWithSRVName:(NSString *)aSRVName timeout:(NSTimeInterval)aTimeout // Save parameters - srvName = [aSRVName copy]; + self->srvName = [aSRVName copy]; - timeout = aTimeout; + self->timeout = aTimeout; // Check parameters - const char *srvNameCStr = [srvName cStringUsingEncoding:NSASCIIStringEncoding]; + const char *srvNameCStr = [self->srvName cStringUsingEncoding:NSASCIIStringEncoding]; if (srvNameCStr == NULL) { [self failWithDNSError:kDNSServiceErr_BadParam]; @@ -510,7 +510,7 @@ - (void)startWithSRVName:(NSString *)aSRVName timeout:(NSTimeInterval)aTimeout // Create DNS Service DNSServiceErrorType sdErr; - sdErr = DNSServiceQueryRecord(&sdRef, // Pointer to unitialized DNSServiceRef + sdErr = DNSServiceQueryRecord(&self->sdRef, // Pointer to unitialized DNSServiceRef kDNSServiceFlagsReturnIntermediates, // Flags kDNSServiceInterfaceIndexAny, // Interface index srvNameCStr, // Full domain name @@ -527,17 +527,17 @@ - (void)startWithSRVName:(NSString *)aSRVName timeout:(NSTimeInterval)aTimeout // Extract unix socket (so we can poll for events) - sdFd = DNSServiceRefSockFD(sdRef); - if (sdFd < 0) + self->sdFd = DNSServiceRefSockFD(self->sdRef); + if (self->sdFd < 0) { // Todo... } // Create GCD read source for sd file descriptor - sdReadSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_READ, sdFd, 0, resolverQueue); + self->sdReadSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_READ, self->sdFd, 0, self->resolverQueue); - dispatch_source_set_event_handler(sdReadSource, ^{ @autoreleasepool { + dispatch_source_set_event_handler(self->sdReadSource, ^{ @autoreleasepool { XMPPLogVerbose(@"%@: sdReadSource_eventHandler", THIS_FILE); @@ -546,7 +546,7 @@ - (void)startWithSRVName:(NSString *)aSRVName timeout:(NSTimeInterval)aTimeout // Invoking DNSServiceProcessResult will invoke our QueryRecordCallback, // the callback we set when we created the sdRef. - DNSServiceErrorType dnsErr = DNSServiceProcessResult(sdRef); + DNSServiceErrorType dnsErr = DNSServiceProcessResult(self->sdRef); if (dnsErr != kDNSServiceErr_NoError) { [self failWithDNSError:dnsErr]; @@ -557,9 +557,9 @@ - (void)startWithSRVName:(NSString *)aSRVName timeout:(NSTimeInterval)aTimeout #if !OS_OBJECT_USE_OBJC dispatch_source_t theSdReadSource = sdReadSource; #endif - DNSServiceRef theSdRef = sdRef; + DNSServiceRef theSdRef = self->sdRef; - dispatch_source_set_cancel_handler(sdReadSource, ^{ @autoreleasepool { + dispatch_source_set_cancel_handler(self->sdReadSource, ^{ @autoreleasepool { XMPPLogVerbose(@"%@: sdReadSource_cancelHandler", THIS_FILE); @@ -570,15 +570,15 @@ - (void)startWithSRVName:(NSString *)aSRVName timeout:(NSTimeInterval)aTimeout }}); - dispatch_resume(sdReadSource); + dispatch_resume(self->sdReadSource); // Create timer (if requested timeout > 0) - if (timeout > 0.0) + if (self->timeout > 0.0) { - timeoutTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, resolverQueue); + self->timeoutTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, self->resolverQueue); - dispatch_source_set_event_handler(timeoutTimer, ^{ @autoreleasepool { + dispatch_source_set_event_handler(self->timeoutTimer, ^{ @autoreleasepool { NSString *errMsg = @"Operation timed out"; NSDictionary *userInfo = @{NSLocalizedDescriptionKey : errMsg}; @@ -589,13 +589,13 @@ - (void)startWithSRVName:(NSString *)aSRVName timeout:(NSTimeInterval)aTimeout }}); - dispatch_time_t tt = dispatch_time(DISPATCH_TIME_NOW, (timeout * NSEC_PER_SEC)); + dispatch_time_t tt = dispatch_time(DISPATCH_TIME_NOW, (self->timeout * NSEC_PER_SEC)); - dispatch_source_set_timer(timeoutTimer, tt, DISPATCH_TIME_FOREVER, 0); - dispatch_resume(timeoutTimer); + dispatch_source_set_timer(self->timeoutTimer, tt, DISPATCH_TIME_FOREVER, 0); + dispatch_resume(self->timeoutTimer); } - resolveInProgress = YES; + self->resolveInProgress = YES; }}; if (dispatch_get_specific(resolverQueueTag)) @@ -610,39 +610,39 @@ - (void)stop XMPPLogTrace(); - delegate = nil; - if (delegateQueue) + self->delegate = nil; + if (self->delegateQueue) { #if !OS_OBJECT_USE_OBJC dispatch_release(delegateQueue); #endif - delegateQueue = NULL; + self->delegateQueue = NULL; } - [results removeAllObjects]; + [self->results removeAllObjects]; - if (sdReadSource) + if (self->sdReadSource) { // Cancel the readSource. // It will be released from within the cancel handler. - dispatch_source_cancel(sdReadSource); - sdReadSource = NULL; - sdFd = -1; + dispatch_source_cancel(self->sdReadSource); + self->sdReadSource = NULL; + self->sdFd = -1; // The sdRef will be deallocated from within the cancel handler too. - sdRef = NULL; + self->sdRef = NULL; } - if (timeoutTimer) + if (self->timeoutTimer) { - dispatch_source_cancel(timeoutTimer); + dispatch_source_cancel(self->timeoutTimer); #if !OS_OBJECT_USE_OBJC dispatch_release(timeoutTimer); #endif - timeoutTimer = NULL; + self->timeoutTimer = NULL; } - resolveInProgress = NO; + self->resolveInProgress = NO; }}; if (dispatch_get_specific(resolverQueueTag)) diff --git a/XMPPFramework.xcodeproj/project.pbxproj b/XMPPFramework.xcodeproj/project.pbxproj index ce2497d077..b334b4443f 100644 --- a/XMPPFramework.xcodeproj/project.pbxproj +++ b/XMPPFramework.xcodeproj/project.pbxproj @@ -178,7 +178,6 @@ D9DCD2521E6250930010D1C7 /* XMPPIncomingFileTransfer.h in Headers */ = {isa = PBXBuildFile; fileRef = D9DCD1281E6250920010D1C7 /* XMPPIncomingFileTransfer.h */; settings = {ATTRIBUTES = (Public, ); }; }; D9DCD2531E6250930010D1C7 /* XMPPIncomingFileTransfer.m in Sources */ = {isa = PBXBuildFile; fileRef = D9DCD1291E6250920010D1C7 /* XMPPIncomingFileTransfer.m */; }; D9DCD2541E6250930010D1C7 /* XMPPOutgoingFileTransfer.h in Headers */ = {isa = PBXBuildFile; fileRef = D9DCD12A1E6250920010D1C7 /* XMPPOutgoingFileTransfer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D9DCD2551E6250930010D1C7 /* XMPPOutgoingFileTransfer.m in Sources */ = {isa = PBXBuildFile; fileRef = D9DCD12B1E6250920010D1C7 /* XMPPOutgoingFileTransfer.m */; }; D9DCD2561E6250930010D1C7 /* XMPPGoogleSharedStatus.h in Headers */ = {isa = PBXBuildFile; fileRef = D9DCD12D1E6250920010D1C7 /* XMPPGoogleSharedStatus.h */; settings = {ATTRIBUTES = (Public, ); }; }; D9DCD2571E6250930010D1C7 /* XMPPGoogleSharedStatus.m in Sources */ = {isa = PBXBuildFile; fileRef = D9DCD12E1E6250920010D1C7 /* XMPPGoogleSharedStatus.m */; }; D9DCD2581E6250930010D1C7 /* NSXMLElement+OMEMO.h in Headers */ = {isa = PBXBuildFile; fileRef = D9DCD1301E6250920010D1C7 /* NSXMLElement+OMEMO.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -1056,6 +1055,7 @@ DD855F941F74F2B000E12330 /* XMPPOutOfBandResourceMessaging.m in Sources */ = {isa = PBXBuildFile; fileRef = DD855F901F74F2B000E12330 /* XMPPOutOfBandResourceMessaging.m */; }; DD855F951F74F2B000E12330 /* XMPPOutOfBandResourceMessaging.m in Sources */ = {isa = PBXBuildFile; fileRef = DD855F901F74F2B000E12330 /* XMPPOutOfBandResourceMessaging.m */; }; DD855F961F74F2B000E12330 /* XMPPOutOfBandResourceMessaging.m in Sources */ = {isa = PBXBuildFile; fileRef = DD855F901F74F2B000E12330 /* XMPPOutOfBandResourceMessaging.m */; }; + FB9BD59220F3CD1B00B93A7E /* XMPPOutgoingFileTransfer.m in Sources */ = {isa = PBXBuildFile; fileRef = D9DCD12B1E6250920010D1C7 /* XMPPOutgoingFileTransfer.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -1546,7 +1546,7 @@ D9DCD1281E6250920010D1C7 /* XMPPIncomingFileTransfer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMPPIncomingFileTransfer.h; sourceTree = ""; }; D9DCD1291E6250920010D1C7 /* XMPPIncomingFileTransfer.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = XMPPIncomingFileTransfer.m; sourceTree = ""; }; D9DCD12A1E6250920010D1C7 /* XMPPOutgoingFileTransfer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMPPOutgoingFileTransfer.h; sourceTree = ""; }; - D9DCD12B1E6250920010D1C7 /* XMPPOutgoingFileTransfer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMPPOutgoingFileTransfer.m; sourceTree = ""; }; + D9DCD12B1E6250920010D1C7 /* XMPPOutgoingFileTransfer.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = XMPPOutgoingFileTransfer.m; sourceTree = ""; }; D9DCD12D1E6250920010D1C7 /* XMPPGoogleSharedStatus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMPPGoogleSharedStatus.h; sourceTree = ""; }; D9DCD12E1E6250920010D1C7 /* XMPPGoogleSharedStatus.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMPPGoogleSharedStatus.m; sourceTree = ""; }; D9DCD1301E6250920010D1C7 /* NSXMLElement+OMEMO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSXMLElement+OMEMO.h"; sourceTree = ""; }; @@ -4008,7 +4008,6 @@ D9DCD3131E6250930010D1C7 /* XEP_0223.m in Sources */, D9DCD2651E6250930010D1C7 /* XMPPIQ+OMEMO.m in Sources */, D9DCD3151E6250930010D1C7 /* XMPPAttentionModule.m in Sources */, - D9DCD2551E6250930010D1C7 /* XMPPOutgoingFileTransfer.m in Sources */, D9DCD2951E6250930010D1C7 /* XMPPRoomOccupantCoreDataStorageObject.m in Sources */, D9DCD2931E6250930010D1C7 /* XMPPRoomMessageCoreDataStorageObject.m in Sources */, DD1E73361ED885FD009B529B /* XMPPRoomLightCoreDataStorage+XEP_0313.m in Sources */, @@ -4094,6 +4093,7 @@ 0D44BB531E537105000930E0 /* XMPPSCRAMSHA1Authentication.m in Sources */, D9DCD32B1E6250930010D1C7 /* XMPPIQ+XEP_0357.m in Sources */, DD855F941F74F2B000E12330 /* XMPPOutOfBandResourceMessaging.m in Sources */, + FB9BD59220F3CD1B00B93A7E /* XMPPOutgoingFileTransfer.m in Sources */, DD1C59861F4429FD003D73DB /* XMPPDelayedDelivery.m in Sources */, D9DCD2F71E6250930010D1C7 /* XMPPvCardAvatarModule.m in Sources */, D9DCD26B1E6250930010D1C7 /* XMPPReconnect.m in Sources */,