aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
diff options
context:
space:
mode:
authorDaniel Gultsch <inputmice@siacs.eu>2015-01-02 12:04:33 +0100
committerDaniel Gultsch <inputmice@siacs.eu>2015-01-02 12:04:33 +0100
commitbcd3be59ce78609e608f4a8f7a868be977fdb4bb (patch)
tree4437c8567a7c18786f8f35b76f3aff444dfe3511 /src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
parent8d2f454479632465387d8d824a56bd46aa9397e5 (diff)
put Conversations into background mode earlier
Diffstat (limited to 'src/main/java/eu/siacs/conversations/services/XmppConnectionService.java')
-rw-r--r--src/main/java/eu/siacs/conversations/services/XmppConnectionService.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
index dc895e5b..bdc51783 100644
--- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
@@ -1272,7 +1272,9 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
private boolean checkListeners() {
return (this.mOnAccountUpdate == null
- && this.mOnConversationUpdate == null && this.mOnRosterUpdate == null);
+ && this.mOnConversationUpdate == null
+ && this.mOnRosterUpdate == null
+ && this.mOnUpdateBlocklist == null);
}
private void switchToForeground() {
@@ -1996,20 +1998,22 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
return null;
}
- public void markRead(Conversation conversation, boolean calledByUi) {
+ public void markRead(final Conversation conversation) {
mNotificationService.clear(conversation);
- final Message markable = conversation.getLatestMarkableMessage();
conversation.markRead();
- if (confirmMessages() && markable != null && markable.getRemoteMsgId() != null && calledByUi) {
+ }
+
+ public void sendReadMarker(final Conversation conversation) {
+ final Message markable = conversation.getLatestMarkableMessage();
+ this.markRead(conversation);
+ if (confirmMessages() && markable != null && markable.getRemoteMsgId() != null) {
Log.d(Config.LOGTAG, conversation.getAccount().getJid().toBareJid()+ ": sending read marker to " + markable.getCounterpart().toString());
Account account = conversation.getAccount();
final Jid to = markable.getCounterpart();
MessagePacket packet = mMessageGenerator.confirm(account, to, markable.getRemoteMsgId());
this.sendMessagePacket(conversation.getAccount(),packet);
}
- if (!calledByUi) {
- updateConversationUi();
- }
+ updateConversationUi();
}
public SecureRandom getRNG() {