aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRahix <rahix@rahix.de>2019-05-16 08:24:23 +0200
committerRahix <rahix@rahix.de>2019-05-16 09:02:37 +0200
commit80b946c85c9235deb5471cdc4f0d561a4fb5a3bb (patch)
treef2c9d04ce7687152871ba8ce0e647dcf8bf3ccc8
parent9d19cdbf4ec5109f078193daf6ab55df6f69ec93 (diff)
downloaddino-80b946c85c9235deb5471cdc4f0d561a4fb5a3bb.tar.gz
dino-80b946c85c9235deb5471cdc4f0d561a4fb5a3bb.zip
Fix notifications for servers without MAM
This commit re-adds the change from 4ad07fe: Fix messages never being notified from servers without MAM (#432) Signed-off-by: Rahix <rahix@rahix.de>
-rw-r--r--libdino/src/service/notification_events.vala7
1 files changed, 6 insertions, 1 deletions
diff --git a/libdino/src/service/notification_events.vala b/libdino/src/service/notification_events.vala
index 010341e3..6a99653e 100644
--- a/libdino/src/service/notification_events.vala
+++ b/libdino/src/service/notification_events.vala
@@ -44,7 +44,12 @@ public class NotificationEvents : StreamInteractionModule, Object {
}
private void on_content_item_received(ContentItem item, Conversation conversation) {
- if (!synced_accounts.contains(conversation.account)) {
+ bool is_mam_message = true;
+ if (item.type_ == MessageItem.TYPE) {
+ // If this message is not for MAM, always notify
+ is_mam_message = Xep.MessageArchiveManagement.MessageFlag.get_flag((item as MessageItem).message.stanza) != null;
+ }
+ if (!synced_accounts.contains(conversation.account) && is_mam_message) {
if (!mam_potential_new.has_key(conversation.account)) {
mam_potential_new[conversation.account] = new HashMap<Conversation, ContentItem>(Conversation.hash_func, Conversation.equals_func);
}