diff options
author | fiaxh <git@lightrise.org> | 2019-05-21 22:04:49 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2019-05-26 20:20:09 +0200 |
commit | e1e36fc98e460a8cadba9b81af7a14b47806758a (patch) | |
tree | df43976d3c0f4a680a492c1bd40f5ad7da860443 /libdino/src/service | |
parent | 03f25e1f87dd4608c7cf4d0f97d1cb2e0141094d (diff) | |
download | dino-e1e36fc98e460a8cadba9b81af7a14b47806758a.tar.gz dino-e1e36fc98e460a8cadba9b81af7a14b47806758a.zip |
Fix notifications for servers without MAM using StreamFlag as availability indicator
Diffstat (limited to 'libdino/src/service')
-rw-r--r-- | libdino/src/service/notification_events.vala | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libdino/src/service/notification_events.vala b/libdino/src/service/notification_events.vala index 47ec44e1..1beeb4ed 100644 --- a/libdino/src/service/notification_events.vala +++ b/libdino/src/service/notification_events.vala @@ -44,7 +44,15 @@ public class NotificationEvents : StreamInteractionModule, Object { } private void on_content_item_received(ContentItem item, Conversation conversation) { - if (!synced_accounts.contains(conversation.account)) { + + // Don't wait for MAM sync on servers without MAM + bool mam_available = true; + XmppStream? stream = stream_interactor.get_stream(conversation.account); + if (stream != null) { + mam_available = stream.get_flag(Xep.MessageArchiveManagement.Flag.IDENTITY) != null; + } + + if (mam_available && !synced_accounts.contains(conversation.account)) { if (!mam_potential_new.has_key(conversation.account)) { mam_potential_new[conversation.account] = new HashMap<Conversation, ContentItem>(Conversation.hash_func, Conversation.equals_func); } |