From 59e289090a6845f8b9d6a4a4c6067cf6280e3d20 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 26 Aug 2017 20:31:13 +0300 Subject: Fix moving to previous/next mail message in mail view window. --- src/gui/windows/mailwindow.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/gui/windows/mailwindow.cpp b/src/gui/windows/mailwindow.cpp index 5536aecbc..ca11306ac 100644 --- a/src/gui/windows/mailwindow.cpp +++ b/src/gui/windows/mailwindow.cpp @@ -277,7 +277,8 @@ void MailWindow::viewNext(const int64_t id) FOR_EACH (STD_VECTOR::iterator, it, mMessages) { MailMessage *message = *it; - if ((message != nullptr) && message->id == id) + if (message != nullptr && + message->id == id) { ++ it; if (it == mMessages.end()) @@ -290,7 +291,10 @@ void MailWindow::viewNext(const int64_t id) mListBox->setSelected(mListBox->getSelected() + 1); } message = *it; - mailHandler->readMessage(message->id); + if (mUseMail2) + mail2Handler->readMail(mOpenType, message->id); + else + mailHandler->readMessage(message->id); return; } } @@ -301,7 +305,8 @@ void MailWindow::viewPrev(const int64_t id) FOR_EACH (STD_VECTOR::iterator, it, mMessages) { MailMessage *message = *it; - if ((message != nullptr) && message->id == id) + if (message != nullptr && + message->id == id) { if (it == mMessages.begin()) { @@ -314,7 +319,10 @@ void MailWindow::viewPrev(const int64_t id) } -- it; message = *it; - mailHandler->readMessage(message->id); + if (mUseMail2) + mail2Handler->readMail(mOpenType, message->id); + else + mailHandler->readMessage(message->id); return; } } -- cgit v1.2.3-70-g09d2