Commit b0cddb2b authored by VDVsx's avatar VDVsx

Merge pull request #80 from nemomobile-packages/upgrade-1.1.6

[imap-idle] Check if IDLE connection needs to be established after login. Fixes JB#28693
parents 14903b49 3f426ef0
......@@ -987,6 +987,16 @@ void ImapClient::commandTransition(ImapCommand command, OperationStatus status)
}
#endif
}
// After logging in server capabilities reported may change so we need to
// check if IDLE is already established, when enabled
if (!_waitingForIdle && !_idlesEstablished
&& _protocol.supportsCapability("IDLE")
&& !_waitingForIdleFolderIds.isEmpty()
&& _pushConnectionsReserved) {
_waitingForIdle = true;
monitor(_waitingForIdleFolderIds);
emit updateStatus( tr("Logging in idle connection" ) );
}
bool compressCapable(_protocol.capabilities().contains("COMPRESS=DEFLATE", Qt::CaseInsensitive));
if (!_protocol.encrypted() && QMFALLOWCOMPRESS && compressCapable && !_protocol.compress()) {
......
......@@ -1936,7 +1936,7 @@ void ImapService::onOnlineStateChanged(bool isOnline)
qMailLog(Messaging) << "IDLE Session: Network state changed: " << isOnline;
if (accountPushEnabled() && isOnline && (!_networkSession || _networkSession->state() != QNetworkSession::Connected)) {
openIdleSession();
} else if (!isOnline) {
} else if (!isOnline) {
onSessionError(QNetworkSession::InvalidConfigurationError);
closeIdleSession();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment