aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r--src/main/java/de/pixart/messenger/parser/MessageParser.java9
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java3
2 files changed, 5 insertions, 7 deletions
diff --git a/src/main/java/de/pixart/messenger/parser/MessageParser.java b/src/main/java/de/pixart/messenger/parser/MessageParser.java
index dd97291a1..dead57709 100644
--- a/src/main/java/de/pixart/messenger/parser/MessageParser.java
+++ b/src/main/java/de/pixart/messenger/parser/MessageParser.java
@@ -732,13 +732,14 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
if (conversation != null && id != null && sender != null) {
Message message = conversation.findMessageWithRemoteId(id, sender);
if (message != null) {
- if (conversation.getMucOptions().isSelf(counterpart)) {
+ final Jid fallback = conversation.getMucOptions().getTrueCounterpart(counterpart);
+ final Jid trueJid = getTrueCounterpart((query != null && query.safeToExtractTrueCounterpart()) ? mucUserElement : null, fallback);
+ final boolean trueJidMatchesAccount = account.getJid().toBareJid().equals(trueJid == null ? null : trueJid.toBareJid());
+ if (trueJidMatchesAccount || conversation.getMucOptions().isSelf(counterpart)) {
if (!message.isRead() && (query == null || query.isCatchup())) { //checking if message is unread fixes race conditions with reflections
mXmppConnectionService.markRead(conversation);
}
- } else {
- final Jid fallback = conversation.getMucOptions().getTrueCounterpart(counterpart);
- Jid trueJid = getTrueCounterpart((query != null && query.safeToExtractTrueCounterpart()) ? mucUserElement : null, fallback);
+ } else if (!counterpart.isBareJid() && trueJid != null){
ReadByMarker readByMarker = ReadByMarker.from(counterpart, trueJid);
if (message.addReadByMarker(readByMarker)) {
Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": added read by (" + readByMarker.getRealJid() + ") to message '" + message.getBody() + "'");
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
index c37c5cee7..90a3057ba 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -1418,9 +1418,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
state = ChatState.PAUSED;
users = conversation.getMucOptions().getUsersWithChatState(state, 5);
}
- int markersAdded = 0;
if (mucOptions.membersOnly() && mucOptions.nonanonymous()) {
- //addedMarkers.addAll(ReadByMarker.from(users));
for (int i = this.messageList.size() - 1; i >= 0; --i) {
final Set<ReadByMarker> markersForMessage = messageList.get(i).getReadByMarkers();
final List<MucOptions.User> shownMarkers = new ArrayList<>();
@@ -1453,7 +1451,6 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
statusMessage = null;
}
if (statusMessage != null) {
- ++markersAdded;
this.messageList.add(i + 1, statusMessage);
}
addedMarkers.add(markerForSender);