move chat state reset from background switch to foreground switch to account for chat states sent in the mean time

This commit is contained in:
Daniel Gultsch 2015-10-19 23:22:29 +02:00
parent 9b07059b6e
commit 53125dbccc

View file

@ -1636,6 +1636,9 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
}
private void switchToForeground() {
for (Conversation conversation : getConversations()) {
conversation.setIncomingChatState(ChatState.ACTIVE);
}
for (Account account : getAccounts()) {
if (account.getStatus() == Account.State.ONLINE) {
XmppConnection connection = account.getXmppConnection();
@ -1656,9 +1659,6 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
}
}
}
for (Conversation conversation : getConversations()) {
conversation.setIncomingChatState(ChatState.ACTIVE);
}
this.mNotificationService.setIsInForeground(false);
Log.d(Config.LOGTAG, "app switched into background");
}