mirror of https://github.com/zulip/zulip.git
delete_messages: Pass a list of user ids in the event in all cases.
The bulk deletion codepath was using dicts instead of user ids in the event, as opposed to the other codepath which was adjusted to pass just user ids before. We make the bulk codepath consistent with the other one. Due to the dict-type events happening in 3.*, we move the goal for deleting the compat code in process_notification to 5.0.
This commit is contained in:
parent
8ffb828030
commit
c3a8a15bae
|
@ -5790,8 +5790,7 @@ def do_delete_messages(realm: Realm, messages: Iterable[Message]) -> None:
|
|||
subscribers = get_active_subscriptions_for_stream_id(stream_id)
|
||||
# We exclude long-term idle users, since they by definition have no active clients.
|
||||
subscribers = subscribers.exclude(user_profile__long_term_idle=True)
|
||||
subscriber_ids = [user.user_profile_id for user in subscribers]
|
||||
users_to_notify = list(map(subscriber_info, subscriber_ids))
|
||||
users_to_notify = list(subscribers.values_list("user_profile_id", flat=True))
|
||||
archiving_chunk_size = retention.STREAM_MESSAGE_BATCH_SIZE
|
||||
|
||||
move_messages_to_archive(message_ids, realm=realm, chunk_size=archiving_chunk_size)
|
||||
|
|
|
@ -1206,7 +1206,8 @@ def process_notification(notice: Mapping[str, Any]) -> None:
|
|||
# compatibility with events in that format still in the
|
||||
# queue at the time of upgrade.
|
||||
#
|
||||
# TODO: Remove this block in release >= 4.0.
|
||||
# TODO/compatibility: Remove this block once you can no
|
||||
# longer directly upgrade directly from 3.x to master.
|
||||
user_ids: List[int] = [user["id"] for user in cast(List[Mapping[str, int]], users)]
|
||||
else:
|
||||
user_ids = cast(List[int], users)
|
||||
|
|
Loading…
Reference in New Issue