From e802be0fded243dbf33c7091dd04a1b89cd875ca Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Thu, 8 Nov 2018 15:12:10 +0000 Subject: [PATCH] Remove "subject" in notifications.py. These last few are all pretty safe. --- tools/linter_lib/custom_check.py | 1 + zerver/lib/notifications.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/linter_lib/custom_check.py b/tools/linter_lib/custom_check.py index b7025a6118..059f7f028e 100644 --- a/tools/linter_lib/custom_check.py +++ b/tools/linter_lib/custom_check.py @@ -280,6 +280,7 @@ def build_custom_checkers(by_lang): 'zerver/lib/actions.py', 'zerver/lib/test_classes.py', 'zerver/lib/message.py', + 'zerver/lib/notifications.py', 'zerver/lib/topic_mutes.py'])}, {'pattern': '^(?!#)@login_required', 'description': '@login_required is unsupported; use @zulip_login_required', diff --git a/zerver/lib/notifications.py b/zerver/lib/notifications.py index 98dd2bce5b..f55bb42d25 100644 --- a/zerver/lib/notifications.py +++ b/zerver/lib/notifications.py @@ -270,10 +270,10 @@ def do_send_missedmessage_events_reply_in_zulip(user_profile: UserProfile, if not user_profile.enable_offline_email_notifications: return - recipients = set((msg['message'].recipient_id, msg['message'].subject) for msg in missed_messages) + recipients = set((msg['message'].recipient_id, msg['message'].topic_name()) for msg in missed_messages) if len(recipients) != 1: raise ValueError( - 'All missed_messages must have the same recipient and subject %r' % + 'All missed_messages must have the same recipient and topic %r' % recipients ) @@ -439,7 +439,7 @@ def handle_missedmessage_emails(user_profile_id: int, bucket_tups = sorted(bucket_tups, key=lambda x: x[1]) - # Send an email per recipient subject pair + # Send an email per bucket. for bucket_tup, ignored_max_id in bucket_tups: unique_messages = {} for m in messages_by_bucket[bucket_tup]: