Skip to content

Commit

Permalink
fix: do not fetch unread count for archived channels
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkothari22 committed Feb 23, 2024
1 parent ac0d9f3 commit 3b3149b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions raven/api/raven_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ def get_unread_count_for_channels():
.left_join(channel_member)
.on((channel.name == channel_member.channel_id) & (channel_member.user_id == frappe.session.user))
.where((channel.type == "Open") | (channel_member.user_id == frappe.session.user))
.where(channel.is_archived == 0)
.left_join(message).on(channel.name == message.channel_id))

channels_query = query.select(channel.name, channel.is_direct_message, Count(Case().when(message.creation > Coalesce(channel_member.last_visit, '2000-11-11'), 1)).as_(
Expand Down

0 comments on commit 3b3149b

Please sign in to comment.