From 7bc7853d1ac8586454caac081e2d3bd454e03044 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 24 Feb 2018 17:31:41 +0100 Subject: [PATCH] register open conversation with notification service --- .../java/eu/siacs/conversations/ui/ConversationActivity.java | 1 + .../java/eu/siacs/conversations/ui/ConversationFragment.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index 4359b274b..fced378a3 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -98,6 +98,7 @@ public class ConversationActivity extends XmppActivity implements OnConversation notifyFragmentOfBackendConnected(id); } invalidateActionBarTitle(); + xmppConnectionService.getNotificationService().setIsInForeground(true); Intent intent = pendingViewIntent.pop(); if (intent != null) { if (processViewIntent(intent)) { diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index 07360bba0..805aca945 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -1580,6 +1580,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke this.activity.xmppConnectionService.updateConversation(this.conversation); } updateChatState(this.conversation, msg); + this.activity.xmppConnectionService.getNotificationService().setOpenConversation(null); } } @@ -1658,6 +1659,8 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke } if (activity != null) { activity.onConversationRead(this.conversation); + //TODO if we only do this when this fragment is running on main it won't *bing* in tablet layout which might be unnecessary since we can *see* it + activity.xmppConnectionService.getNotificationService().setOpenConversation(this.conversation); } }