mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
message: Respect first_visible_message_id when computing unreads.
This prevents unread counts for messages which the web UI does not display, and does not let you mark as unread via "mark all as read."
This commit is contained in:
committed by
Tim Abbott
parent
e73e44402a
commit
cb2a105de2
@@ -579,10 +579,11 @@ def get_raw_unread_data(
|
|||||||
user_profile: UserProfile, message_ids: Optional[List[int]] = None
|
user_profile: UserProfile, message_ids: Optional[List[int]] = None
|
||||||
) -> RawUnreadMessagesResult:
|
) -> RawUnreadMessagesResult:
|
||||||
excluded_recipient_ids = get_inactive_recipient_ids(user_profile)
|
excluded_recipient_ids = get_inactive_recipient_ids(user_profile)
|
||||||
|
first_visible_message_id = get_first_visible_message_id(user_profile.realm)
|
||||||
user_msgs = (
|
user_msgs = (
|
||||||
UserMessage.objects.filter(
|
UserMessage.objects.filter(
|
||||||
user_profile=user_profile,
|
user_profile=user_profile,
|
||||||
|
message_id__gte=first_visible_message_id,
|
||||||
)
|
)
|
||||||
.exclude(
|
.exclude(
|
||||||
message__recipient_id__in=excluded_recipient_ids,
|
message__recipient_id__in=excluded_recipient_ids,
|
||||||
|
|||||||
Reference in New Issue
Block a user