Session: emit connectionLost when getting disconnected before the initial OK

Authored by dfaure on Apr 21 2018, 5:22 PM.

Description

Session: emit connectionLost when getting disconnected before the initial OK

Summary:
This commit cleans up the meaning of connectionLost so that it can be used
again by the imap resource session pool. It is now only emitted when losing
connection, after actually being connected. This allows to distinguish
that case from the case of a non-existent server.

Test Plan: Adapted unittest; more tests in imap resource based on this.

Reviewers: ervin, dvratil

Reviewed By: dvratil

Subscribers: KDE PIM

Differential Revision: https://phabricator.kde.org/D12417