Skip to content

Commit 5bb556f

Browse files
committed
Merge pull request robbiehanson#172 from andrewtj/atj-fix-inverted-queue-asserts
Fix inverted queue asserts
2 parents c90e9b2 + 2b280f2 commit 5bb556f

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Extensions/CoreDataStorage/XMPPCoreDataStorage.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ - (void)executeBlock:(dispatch_block_t)block
765765
// If you remove the assert statement below, you are destroying the sole purpose for this class,
766766
// which is to optimize the disk IO by buffering save operations.
767767
//
768-
NSAssert(dispatch_get_specific(storageQueueTag), @"Invoked on incorrect queue");
768+
NSAssert(!dispatch_get_specific(storageQueueTag), @"Invoked on incorrect queue");
769769
//
770770
// For a full discussion of this method, please see XMPPCoreDataStorageProtocol.h
771771
//
@@ -795,7 +795,7 @@ - (void)scheduleBlock:(dispatch_block_t)block
795795
// If you remove the assert statement below, you are destroying the sole purpose for this class,
796796
// which is to optimize the disk IO by buffering save operations.
797797
//
798-
NSAssert(dispatch_get_specific(storageQueueTag), @"Invoked on incorrect queue");
798+
NSAssert(!dispatch_get_specific(storageQueueTag), @"Invoked on incorrect queue");
799799
//
800800
// For a full discussion of this method, please see XMPPCoreDataStorageProtocol.h
801801
//

Extensions/Reconnect/XMPPReconnect.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ - (void)maybeAttemptReconnectWithTicket:(int)ticket
525525

526526
- (void)maybeAttemptReconnectWithReachabilityFlags:(SCNetworkReachabilityFlags)reachabilityFlags
527527
{
528-
if (dispatch_get_specific(moduleQueueTag))
528+
if (!dispatch_get_specific(moduleQueueTag))
529529
{
530530
dispatch_async(moduleQueue, ^{ @autoreleasepool {
531531

Extensions/XEP-0115/CoreDataStorage/XMPPCapabilitiesCoreDataStorage.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ - (NSXMLElement *)capabilitiesForJID:(XMPPJID *)jid xmppStream:(XMPPStream *)str
220220
- (NSXMLElement *)capabilitiesForJID:(XMPPJID *)jid ext:(NSString **)extPtr xmppStream:(XMPPStream *)stream
221221
{
222222
// By design this method should not be invoked from the storageQueue.
223-
NSAssert(dispatch_get_specific(storageQueueTag), @"Invoked on incorrect queue");
223+
NSAssert(!dispatch_get_specific(storageQueueTag), @"Invoked on incorrect queue");
224224

225225
XMPPLogTrace();
226226

@@ -331,7 +331,7 @@ - (BOOL)getCapabilitiesHash:(NSString **)hashPtr
331331
xmppStream:(XMPPStream *)stream
332332
{
333333
// By design this method should not be invoked from the storageQueue.
334-
NSAssert(dispatch_get_specific(storageQueueTag), @"Invoked on incorrect queue");
334+
NSAssert(!dispatch_get_specific(storageQueueTag), @"Invoked on incorrect queue");
335335

336336
XMPPLogTrace();
337337

@@ -411,7 +411,7 @@ - (void)getCapabilitiesKnown:(BOOL *)areCapabilitiesKnownPtr
411411
xmppStream:(XMPPStream *)stream
412412
{
413413
// By design this method should not be invoked from the storageQueue.
414-
NSAssert(dispatch_get_specific(storageQueueTag), @"Invoked on incorrect queue");
414+
NSAssert(!dispatch_get_specific(storageQueueTag), @"Invoked on incorrect queue");
415415

416416
XMPPLogTrace();
417417

@@ -519,7 +519,7 @@ - (void)setCapabilities:(NSXMLElement *)capabilities forHash:(NSString *)hash al
519519
- (void)setCapabilities:(NSXMLElement *)capabilities forJID:(XMPPJID *)jid xmppStream:(XMPPStream *)stream
520520
{
521521
// By design this method should not be invoked from the storageQueue.
522-
NSAssert(dispatch_get_specific(storageQueueTag), @"Invoked on incorrect queue");
522+
NSAssert(!dispatch_get_specific(storageQueueTag), @"Invoked on incorrect queue");
523523

524524
XMPPLogTrace();
525525

0 commit comments

Comments
 (0)