diff --git a/Monal/Classes/HelperTools.m b/Monal/Classes/HelperTools.m index b84c53f24e..79f9414a64 100644 --- a/Monal/Classes/HelperTools.m +++ b/Monal/Classes/HelperTools.m @@ -1374,8 +1374,12 @@ +(void) updateSyncErrorsWithDeleteOnly:(BOOL) removeOnly andWaitForCompletion:(B for(xmpp* account in [MLXMPPManager sharedInstance].connectedXMPP) { //ignore already disconnected accounts (they are always "idle" but this does not reflect the real sync state) - if(account.accountState < kStateReconnecting && !account.reconnectInProgress) + //but only do so if we have connectivity (we want to alert the user of pending outgoing stanzas even if we don't have connectivity) + if(account.accountState < kStateReconnecting && !account.reconnectInProgress && [[MLXMPPManager sharedInstance] hasConnectivity]) + { + DDLogDebug(@"Ignoring disconnected account: %@", account); continue; + } NSString* syncErrorIdentifier = [NSString stringWithFormat:@"syncError::%@", account.connectionProperties.identity.jid]; //dispatching this to the receive queue isn't neccessary anymore, see comments in account.idle if(account.idle) @@ -1405,6 +1409,7 @@ +(void) updateSyncErrorsWithDeleteOnly:(BOOL) removeOnly andWaitForCompletion:(B if(![self isAppExtension] && !account.isDoingFullReconnect && ![account shouldTriggerSyncErrorForImportantUnackedOutgoingStanzas]) { DDLogWarn(@"NOT posting syncError notification for %@ (we are not in the appex, no important stanzas are unacked and we are not doing a full reconnect)...", account.connectionProperties.identity.jid); + DDLogDebug(@"[self isAppExtension] == %@, account.isDoingFullReconnect == %@, [account shouldTriggerSyncErrorForImportantUnackedOutgoingStanzas] == %@", bool2str([self isAppExtension]), bool2str(account.isDoingFullReconnect), bool2str([account shouldTriggerSyncErrorForImportantUnackedOutgoingStanzas])); continue; } DDLogWarn(@"Posting syncError notification for %@...", account.connectionProperties.identity.jid); diff --git a/Monal/Classes/xmpp.m b/Monal/Classes/xmpp.m index daec778be5..59bc897b75 100644 --- a/Monal/Classes/xmpp.m +++ b/Monal/Classes/xmpp.m @@ -5180,7 +5180,7 @@ -(void) logCatchupStats -(void) handleFinishedCatchup { self->_catchupDone = YES; - self.isDoingFullReconnect = NO; + self.isDoingFullReconnect = !self.connectionProperties.supportsSM3; //log catchup statistics [self logCatchupStats];