FIX: correctly uses private_email site setting in chat (#24528)

Chat will now check for the state of `SiteSetting.private_email` when sending the summary, when enabled, the mail will not display user information, channel information other than the ID and no message information, only the count of messages.
This commit is contained in:
Joffrey JAFFEUX
2023-11-23 15:54:22 +01:00
committed by GitHub
parent 6ac5f34ad7
commit 57584c38c0
4 changed files with 143 additions and 34 deletions

View File

@ -53,6 +53,15 @@ module Chat
end
def summary_subject(user, grouped_messages)
if SiteSetting.private_email
return(
I18n.t(
"user_notifications.chat_summary.subject.private_message",
email_prefix: @email_prefix,
)
)
end
all_channels = grouped_messages.keys
grouped_channels = all_channels.partition { |c| !c.direct_message_channel? }
channels = grouped_channels.first