summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/mail2/libmail/imaphandler.cpp9
-rw-r--r--noncore/unsupported/mail2/libmail/imaphandler.h2
2 files changed, 10 insertions, 1 deletions
diff --git a/noncore/unsupported/mail2/libmail/imaphandler.cpp b/noncore/unsupported/mail2/libmail/imaphandler.cpp
index 66c92c5..730a004 100644
--- a/noncore/unsupported/mail2/libmail/imaphandler.cpp
+++ b/noncore/unsupported/mail2/libmail/imaphandler.cpp
@@ -2,12 +2,13 @@
#include "imaphandler.h"
#include "imapbase.h"
IMAPHandler::IMAPHandler(const Account &account)
: QObject(), _account(account)
{
+ _ready = false;
_loggingin = false;
_loggedin = false;
_tag = 0;
_ibase = new IMAPBase(account);
connect(_ibase, SIGNAL(dataReceived(const QString &)), SLOT(slotDataReceived(const QString &)));
@@ -286,12 +287,20 @@ QString IMAPHandler::tag(bool count)
{
return QString("a%1").arg(count ? _tag++ : _tag);
}
void IMAPHandler::slotDataReceived(const QString &data)
{
+ if (!_ready) {
+ // The first data is always the greeting string.
+ // We can ignore it.
+ _ready = true;
+ return;
+ }
+
+
IMAPResponseParser parser(data);
IMAPResponse response = parser.response();
response.setImapHandler(this);
if (!_loggingin) emit gotResponse(response);
else {
diff --git a/noncore/unsupported/mail2/libmail/imaphandler.h b/noncore/unsupported/mail2/libmail/imaphandler.h
index 8cb42db..cc47a85 100644
--- a/noncore/unsupported/mail2/libmail/imaphandler.h
+++ b/noncore/unsupported/mail2/libmail/imaphandler.h
@@ -76,11 +76,11 @@ protected slots:
void slotError(int err);
private:
Account _account;
IMAPBase *_ibase;
unsigned int _tag;
- bool _loggingin, _loggedin;
+ bool _ready, _loggingin, _loggedin;
};
#endif