message_edit: Clarify name for gaining_usermessage_user_ids.

This list contains user IDs, not subscription objects.
This commit is contained in:
Tim Abbott 2023-04-20 17:21:16 -07:00
parent 3ff361a1f0
commit 71e57d2022
1 changed files with 4 additions and 4 deletions

View File

@ -542,13 +542,13 @@ def do_update_message(
user_profile_id__in=[sub.user_profile_id for sub in subs_losing_usermessages]
)
subs_gaining_usermessages = []
gaining_usermessage_user_ids = []
if not new_stream.is_history_public_to_subscribers():
# For private streams, with history not public to subscribers,
# We find out users who are not present in the msgs' old stream
# and create new UserMessage for these users so that they can
# access this message.
subs_gaining_usermessages += [
gaining_usermessage_user_ids += [
user_id for user_id in new_stream_user_ids if user_id not in old_stream_user_ids
]
@ -620,10 +620,10 @@ def do_update_message(
assert stream_being_edited is not None
changed_message_ids = [msg.id for msg in changed_messages]
if subs_gaining_usermessages:
if gaining_usermessage_user_ids:
ums_to_create = []
for message_id in changed_message_ids:
for user_profile_id in subs_gaining_usermessages:
for user_profile_id in gaining_usermessage_user_ids:
# The fact that the user didn't have a UserMessage originally means we can infer that the user
# was not mentioned in the original message (even if mention syntax was present, it would not
# take effect for a user who was not subscribed). If we were editing the message's content, we