Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
stream_events: Use `is_muted` event instead of `in_home_view` event.
Lauryn Menarda85d58925465
diff --git a/frontend_tests/node_tests/stream_events.js b/frontend_tests/node_tests/stream_events.jsindex d5aeb9ce848..6fced6d3357 100644--- a/frontend_tests/node_tests/stream_events.js+++ b/frontend_tests/node_tests/stream_events.js@@ -120,12 +120,17 @@ test("update_property", ({override}) => {assert.equal(args.val, "blue");}- // Test in home view+ // Test in home view (code coverage; until event/property removed)+ {+ stream_events.update_property(stream_id, "in_home_view", false);+ }++ // Test is muted{const stub = make_stub();override(stream_muting, "update_is_muted", stub.f);override(stream_list, "refresh_muted_or_unmuted_stream", noop);- stream_events.update_property(stream_id, "in_home_view", false);+ stream_events.update_property(stream_id, "is_muted", true);assert.equal(stub.num_calls, 1);const args = stub.get_args("sub", "val");assert.equal(args.sub.stream_id, stream_id);diff --git a/static/js/stream_events.js b/static/js/stream_events.jsindex 36d8ace8004..6d0df553908 100644--- a/static/js/stream_events.js+++ b/static/js/stream_events.js@@ -45,7 +45,11 @@ export function update_property(stream_id, property, value, other_values) {stream_color.update_stream_color(sub, value, {update_historical: true});break;case "in_home_view":- stream_muting.update_is_muted(sub, !value);+ // Legacy in_home_view events are only sent as duplicates of+ // modern is_muted events, which we handle below.+ break;+ case "is_muted":+ stream_muting.update_is_muted(sub, value);stream_list.refresh_muted_or_unmuted_stream(sub);recent_topics_ui.complete_rerender();break;