Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
events: Update stream objects in "unsubscribed" and "never_subscribed" lists.
Sahil Batra319ff6eba21e
diff --git a/zerver/lib/events.py b/zerver/lib/events.pyindex bbc3e26561e..aa70e4dec9a 100644--- a/zerver/lib/events.py+++ b/zerver/lib/events.py@@ -923,17 +923,22 @@ def apply_event(if event["op"] == "update":# For legacy reasons, we call stream data 'subscriptions' in# the state var here, for the benefit of the JS code.- for obj in state["subscriptions"]:- if obj["name"].lower() == event["name"].lower():- obj[event["property"]] = event["value"]- if event["property"] == "description":- obj["rendered_description"] = event["rendered_description"]- if event.get("history_public_to_subscribers") is not None:- obj["history_public_to_subscribers"] = event[- "history_public_to_subscribers"- ]- if event.get("is_web_public") is not None:- obj["is_web_public"] = event["is_web_public"]+ for sub_list in [+ state["subscriptions"],+ state["unsubscribed"],+ state["never_subscribed"],+ ]:+ for obj in sub_list:+ if obj["name"].lower() == event["name"].lower():+ obj[event["property"]] = event["value"]+ if event["property"] == "description":+ obj["rendered_description"] = event["rendered_description"]+ if event.get("history_public_to_subscribers") is not None:+ obj["history_public_to_subscribers"] = event[+ "history_public_to_subscribers"+ ]+ if event.get("is_web_public") is not None:+ obj["is_web_public"] = event["is_web_public"]# Also update the pure streams dataif "streams" in state:for stream in state["streams"]: