From 4ae3201bf07473bf3746b8faf56744055fceffa7 Mon Sep 17 00:00:00 2001 From: David Llewellyn-Jones Date: Fri, 17 Jan 2020 18:41:44 +0200 Subject: Check if IDLE connection needs to be established after login MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some servers only advertise full capabilities after sucessful login, so we need to check if IDLE connection needs to be established in such cases. Created by Valério Valério , 11 May 2015. Change-Id: I307f7be0e07b1639c80f01a3205bcff9de96525a Reviewed-by: Christopher Adams --- src/plugins/messageservices/imap/imapclient.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/plugins/messageservices/imap/imapclient.cpp b/src/plugins/messageservices/imap/imapclient.cpp index 5154234c..a4100fb7 100644 --- a/src/plugins/messageservices/imap/imapclient.cpp +++ b/src/plugins/messageservices/imap/imapclient.cpp @@ -682,6 +682,16 @@ void ImapClient::commandTransition(ImapCommand command, OperationStatus status) qWarning() << "Unable to update account" << account.id() << "to set imap4 configuration"; } } + // 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()) { -- cgit v1.2.3