diff options
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/entities/ReadByMarker.java | 6 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConversationFragment.java | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/ReadByMarker.java b/src/main/java/de/pixart/messenger/entities/ReadByMarker.java index ec2d1aa73..86057c680 100644 --- a/src/main/java/de/pixart/messenger/entities/ReadByMarker.java +++ b/src/main/java/de/pixart/messenger/entities/ReadByMarker.java @@ -162,4 +162,10 @@ public class ReadByMarker { return true; } + public static boolean allUsersRepresented(Collection<MucOptions.User> users, Set<ReadByMarker> markers, ReadByMarker marker) { + HashSet<ReadByMarker> markersCopy = new HashSet<>(markers); + markersCopy.add(marker); + return allUsersRepresented(users, markersCopy); + } + } diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java index 2458e4967..50ee10bf9 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java @@ -2522,6 +2522,8 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke final String body; if (size <= 4) { body = getString(R.string.contacts_have_read_up_to_this_point, UIHelper.concatNames(shownMarkers)); + } else if (ReadByMarker.allUsersRepresented(allUsers, markersForMessage, markerForSender)) { + body = getString(R.string.everyone_has_read_up_to_this_point); } else { body = getString(R.string.contacts_and_n_more_have_read_up_to_this_point, UIHelper.concatNames(shownMarkers, 3), size - 3); } |