mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
mute user: Mark as read old messages immediately.
When a user is muted, in the same request, we mark any existing unreads from that user as read. This is done for all types of messages (PM/huddle/stream) and regardless of whether the user was mentioned in them. This will not break the unread count logic of the web frontend, because that algorithm decides which messages to mark as read based only on the pointer location and the whitespace at the bottom, not on what messages have already been marked as read.
This commit is contained in:
committed by
Tim Abbott
parent
2f56f8d0ed
commit
8b098b95bb
@@ -1011,8 +1011,11 @@ class NormalActionsTest(BaseAction):
|
||||
|
||||
def test_muted_users_events(self) -> None:
|
||||
muted_user = self.example_user("othello")
|
||||
events = self.verify_action(lambda: do_mute_user(self.user_profile, muted_user))
|
||||
check_muted_users("events[0]", events[0])
|
||||
events = self.verify_action(
|
||||
lambda: do_mute_user(self.user_profile, muted_user), num_events=2
|
||||
)
|
||||
check_update_message_flags_add("events[0]", events[0])
|
||||
check_muted_users("events[1]", events[1])
|
||||
|
||||
mute_object = get_mute_object(self.user_profile, muted_user)
|
||||
assert mute_object is not None
|
||||
|
||||
Reference in New Issue
Block a user