From d06e09b9573179db2dce897ea310e80c26940dda Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Thu, 29 Mar 2018 23:18:09 +0200 Subject: register open conversation with notification service --- src/main/java/de/pixart/messenger/ui/ConversationActivity.java | 1 + src/main/java/de/pixart/messenger/ui/ConversationFragment.java | 3 +++ 2 files changed, 4 insertions(+) (limited to 'src/main/java/de/pixart') diff --git a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java index 199f98b16..458fb4bf4 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java @@ -102,6 +102,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/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java index 84af05329..7e9fb1aec 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java @@ -1815,6 +1815,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); } } @@ -1899,6 +1900,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); } } -- cgit v1.2.3