mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
users: Send user remove events on user deactivation.
Guests might lose access to deactivated users if the user is not involved in any DM with guest. This commit adds code to send "realm_user/remove" events for such cases.
This commit is contained in:
@@ -996,6 +996,12 @@ def apply_event(
|
||||
user_profile.realm, person_user_id
|
||||
)
|
||||
state["raw_users"][person_user_id] = inaccessible_user_dict
|
||||
|
||||
if include_subscribers:
|
||||
for sub in state["subscriptions"]:
|
||||
sub["subscribers"] = [
|
||||
user_id for user_id in sub["subscribers"] if user_id != person_user_id
|
||||
]
|
||||
else:
|
||||
raise AssertionError("Unexpected event type {type}/{op}".format(**event))
|
||||
elif event["type"] == "realm_bot":
|
||||
|
||||
Reference in New Issue
Block a user