aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2019-05-21 22:04:49 +0200
committerfiaxh <git@lightrise.org>2019-05-26 20:20:09 +0200
commite1e36fc98e460a8cadba9b81af7a14b47806758a (patch)
treedf43976d3c0f4a680a492c1bd40f5ad7da860443
parent03f25e1f87dd4608c7cf4d0f97d1cb2e0141094d (diff)
downloaddino-e1e36fc98e460a8cadba9b81af7a14b47806758a.tar.gz
dino-e1e36fc98e460a8cadba9b81af7a14b47806758a.zip
Fix notifications for servers without MAM using StreamFlag as availability indicator
-rw-r--r--libdino/src/service/notification_events.vala10
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);
}