diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-03-29 23:18:09 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-03-29 23:18:09 +0200 |
commit | d06e09b9573179db2dce897ea310e80c26940dda (patch) | |
tree | adfc7539f6f6bb1e8219d79e3016db188e1b9f4c | |
parent | 0407f5960c846c19715f3716096769663b3ab919 (diff) |
register open conversation with notification service
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConversationActivity.java | 1 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConversationFragment.java | 3 |
2 files changed, 4 insertions, 0 deletions
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); } } |