register open conversation with notification service

This commit is contained in:
Daniel Gultsch 2018-02-24 17:31:41 +01:00
parent e68fe13a22
commit 7bc7853d1a
2 changed files with 4 additions and 0 deletions

View File

@ -98,6 +98,7 @@ public class ConversationActivity extends XmppActivity implements OnConversation
notifyFragmentOfBackendConnected(id); notifyFragmentOfBackendConnected(id);
} }
invalidateActionBarTitle(); invalidateActionBarTitle();
xmppConnectionService.getNotificationService().setIsInForeground(true);
Intent intent = pendingViewIntent.pop(); Intent intent = pendingViewIntent.pop();
if (intent != null) { if (intent != null) {
if (processViewIntent(intent)) { if (processViewIntent(intent)) {

View File

@ -1580,6 +1580,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
this.activity.xmppConnectionService.updateConversation(this.conversation); this.activity.xmppConnectionService.updateConversation(this.conversation);
} }
updateChatState(this.conversation, msg); 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) { if (activity != null) {
activity.onConversationRead(this.conversation); 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);
} }
} }