ChatMarkers: parse own account from true counterpart
This commit is contained in:
parent
a6864878ba
commit
38797177c7
|
@ -746,13 +746,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() + "'");
|
||||
|
|
|
@ -1391,9 +1391,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<>();
|
||||
|
@ -1426,7 +1424,6 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
|||
statusMessage = null;
|
||||
}
|
||||
if (statusMessage != null) {
|
||||
++markersAdded;
|
||||
this.messageList.add(i + 1, statusMessage);
|
||||
}
|
||||
addedMarkers.add(markerForSender);
|
||||
|
|
Loading…
Reference in New Issue