Commit 19fb5742 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Hide messagewidget when MDN status changed

parent e2398e12
Pipeline #215107 failed with stage
in 44 seconds
......@@ -50,6 +50,7 @@ using namespace MessageViewer;
#include <KIO/JobUiDelegate>
#include <Akonadi/ChangeRecorder>
#include <Akonadi/ContactEditorDialog>
#include "kmail_debug.h"
......@@ -100,6 +101,7 @@ KMReaderWin::KMReaderWin(QWidget *aParent, QWidget *mainWindow, KActionCollectio
connect(mViewer, &MessageViewer::Viewer::showNextMessage, this, &KMReaderWin::showNextMessage);
connect(mViewer, &MessageViewer::Viewer::showPreviousMessage, this, &KMReaderWin::showPreviousMessage);
connect(mViewer->mdnWarning(), &MessageViewer::MDNWarningWidget::sendResponse, this, &KMReaderWin::slotSendMdnResponse);
connect(kmkernel->folderCollectionMonitor(), &Akonadi::Monitor::itemChanged, this, &KMReaderWin::slotItemModified);
mViewer->addMessageLoadedHandler(new MessageViewer::MarkMessageReadHandler(this));
// mViewer->addMessageLoadedHandler(new MailCommon::SendMdnHandler(kmkernel, this));
......@@ -984,3 +986,12 @@ void KMReaderWin::slotSendMdnResponse(MessageViewer::MDNWarningWidget::ResponseT
mViewer->mdnWarning()->animatedHide();
});
}
void KMReaderWin::slotItemModified(const Akonadi::Item &item, const QSet<QByteArray> &partIdentifiers)
{
if (mViewer->messageItem().id() == item.id()) {
if (partIdentifiers.contains("MDNStateAttribute")) {
mViewer->mdnWarning()->animatedHide();
}
}
}
......@@ -220,6 +220,7 @@ private:
void slotSendMdnResponse(MessageViewer::MDNWarningWidget::ResponseType type, KMime::MDN::SendingMode sendingMode);
void sendMdnInfo(const Akonadi::Item &item);
void slotShowMdnInfo(const QPair<QString, bool> &mdnInfo);
void slotItemModified(const Akonadi::Item &item, const QSet<QByteArray> &partIdentifiers);
private:
KContacts::Addressee mSearchedAddress;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment