summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vrátil <dvratil@kde.org>2016-09-14 13:56:59 (GMT)
committerDaniel Vrátil <dvratil@kde.org>2016-09-14 13:56:59 (GMT)
commitdad52613f5aa8717ff92d076db452b9c3f9f5c20 (patch)
treefd1212cce3e6ca740f8b08fd02600b38134102b1
parent37c639a158f78b810e84c84a9c42b6b63571c447 (diff)
Reupload monitor configuration when reconnecting to NtfBus
Fixes issue with notifications not working properly after server restart.
-rw-r--r--src/core/monitor_p.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/core/monitor_p.cpp b/src/core/monitor_p.cpp
index 5f26c26..e0b149e 100644
--- a/src/core/monitor_p.cpp
+++ b/src/core/monitor_p.cpp
@@ -105,6 +105,32 @@ bool MonitorPrivate::connectToNotificationManager()
}
q_ptr->connect(ntfConnection, SIGNAL(commandReceived(qint64,Akonadi::Protocol::Command)),
q_ptr, SLOT(commandReceived(qint64,Akonadi::Protocol::Command)));
+
+ pendingModification = Protocol::ModifySubscriptionCommand();
+ for (const auto &col : collections) {
+ pendingModification.startMonitoringCollection(col.id());
+ }
+ for (const auto &res : resources) {
+ pendingModification.startMonitoringResource(res);
+ }
+ for (auto itemId : items) {
+ pendingModification.startMonitoringItem(itemId);
+ }
+ for (auto tagId : tags) {
+ pendingModification.startMonitoringTag(tagId);
+ }
+ for (auto type : types) {
+ pendingModification.startMonitoringType(static_cast<Protocol::ModifySubscriptionCommand::ChangeType>(type));
+ }
+ for (const auto &mimetype : mimetypes) {
+ pendingModification.startMonitoringMimeType(mimetype);
+ }
+ for (const auto &session : sessions) {
+ pendingModification.startIgnoringSession(session);
+ }
+ pendingModification.setAllMonitored(monitorAll);
+ pendingModification.setExclusive(exclusive);
+
ntfConnection->reconnect();
return true;