FIX: email summary subject order should be consistent (#19469)
This commit is contained in:
parent
4e42759caa
commit
fa8d6860b1
|
@ -63,7 +63,9 @@ module Chat::UserNotificationsExtension
|
||||||
all_channels = grouped_messages.keys
|
all_channels = grouped_messages.keys
|
||||||
grouped_channels = all_channels.partition { |c| !c.direct_message_channel? }
|
grouped_channels = all_channels.partition { |c| !c.direct_message_channel? }
|
||||||
channels = grouped_channels.first
|
channels = grouped_channels.first
|
||||||
dm_users = grouped_channels.last.flat_map { |c| grouped_messages[c].map(&:user) }.uniq
|
|
||||||
|
dm_messages = grouped_channels.last.flat_map { |c| grouped_messages[c] }
|
||||||
|
dm_users = dm_messages.sort_by(&:created_at).uniq { |m| m.user_id }.map(&:user)
|
||||||
|
|
||||||
# Prioritize messages from regular channels over direct messages
|
# Prioritize messages from regular channels over direct messages
|
||||||
if channels.any?
|
if channels.any?
|
||||||
|
|
Loading…
Reference in New Issue