mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
settings: If message content disabled, flush all missed emails informations.
If user has disabled message content in missed email notifications, we shouldn't send any informations about missed messages i.e. sender, stream, message text, etc. to email servers. We are already hiding this informations in email templates, but we shoudln't expose any information about message content if user has disabled this setting.
This commit is contained in:
@@ -299,7 +299,6 @@ def do_send_missedmessage_events_reply_in_zulip(user_profile: UserProfile,
|
||||
context = common_context(user_profile)
|
||||
context.update({
|
||||
'name': user_profile.full_name,
|
||||
'messages': build_message_list(user_profile, missed_messages),
|
||||
'message_count': message_count,
|
||||
'mention': missed_messages[0].is_stream_message(),
|
||||
'unsubscribe_link': unsubscribe_link,
|
||||
@@ -321,12 +320,6 @@ def do_send_missedmessage_events_reply_in_zulip(user_profile: UserProfile,
|
||||
'reply_to_zulip': False,
|
||||
})
|
||||
|
||||
# If there is no content in message, it's not clear what user would be replying to.
|
||||
if not user_profile.message_content_in_email_notifications:
|
||||
context.update({
|
||||
'reply_to_zulip': False,
|
||||
})
|
||||
|
||||
from zerver.lib.email_mirror import create_missed_message_address
|
||||
reply_to_address = create_missed_message_address(user_profile, missed_messages[0])
|
||||
if reply_to_address == FromAddress.NOREPLY:
|
||||
@@ -365,7 +358,18 @@ def do_send_missedmessage_events_reply_in_zulip(user_profile: UserProfile,
|
||||
flags=UserMessage.flags.mentioned).exists()))
|
||||
context.update({'at_mention': True})
|
||||
|
||||
# If message content is disabled, then flush all information we pass to email.
|
||||
if not user_profile.message_content_in_email_notifications:
|
||||
context.update({
|
||||
'reply_to_zulip': False,
|
||||
'messages': [],
|
||||
'sender_str': "",
|
||||
'realm_str': user_profile.realm.name,
|
||||
'huddle_display_name': "",
|
||||
})
|
||||
else:
|
||||
context.update({
|
||||
'messages': build_message_list(user_profile, missed_messages),
|
||||
'sender_str': ", ".join(sender.full_name for sender in senders),
|
||||
'realm_str': user_profile.realm.name,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user