From 97504840d176c2b2dbd51e23d3c2b47c61d1331c Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sat, 27 Jan 2018 21:43:09 +0100 Subject: make chat markers opportunistic in private mucs --- .../de/pixart/messenger/services/XmppConnectionService.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/main/java/de/pixart/messenger/services') diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index f110b5fa8..f3d93cbc0 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -2455,7 +2455,7 @@ public class XmppConnectionService extends Service { if (mucOptions.mamSupport()) { getMessageArchiveService().catchupMUC(conversation); } - if (mucOptions.membersOnly() && mucOptions.nonanonymous()) { + if (mucOptions.isPrivateAndNonAnonymous()) { fetchConferenceMembers(conversation); if (followedInvite && conversation.getBookmark() == null) { saveConversationAsBookmark(conversation, null); @@ -3657,11 +3657,15 @@ public class XmppConnectionService extends Service { } public void sendReadMarker(final Conversation conversation) { - final Message markable = conversation.getLatestMarkableMessage(); + final boolean isPrivateAndNonAnonymousMuc = conversation.getMode() == Conversation.MODE_MULTI && conversation.isPrivateAndNonAnonymous(); + final Message markable = conversation.getLatestMarkableMessage(isPrivateAndNonAnonymousMuc); if (this.markRead(conversation)) { updateConversationUi(); } - if (confirmMessages() && markable != null && markable.trusted() && markable.getRemoteMsgId() != null && markable.getType() != Message.TYPE_PRIVATE) { + if (confirmMessages() + && markable != null + && (markable.trusted() || isPrivateAndNonAnonymousMuc) + && 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(); -- cgit v1.2.3