Skip to content

Commit

Permalink
Merge pull request #80 from nemomobile-packages/upgrade-1.1.6
Browse files Browse the repository at this point in the history
[imap-idle] Check if IDLE connection needs to be established after login. Fixes JB#28693
  • Loading branch information
VDVsx committed May 13, 2015
2 parents 14903b4 + 3f426ef commit b0cddb2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions qmf/src/plugins/messageservices/imap/imapclient.cpp
Expand Up @@ -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()) {
Expand Down
2 changes: 1 addition & 1 deletion qmf/src/plugins/messageservices/imap/imapservice.cpp
Expand Up @@ -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();
}
Expand Down

0 comments on commit b0cddb2

Please sign in to comment.