mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
refactor: Only pass stream_id for set_subscribers.
The goal here is to make all our peer_data functions basically work in id space. Passing a full `sub` to these functions is a legacy of when subscriber info was attached to a full stream "sub" object, but we don't care about anything sub-related (color, description, name, etc.) when we are dealing with subscriptions. When callers pass in stream_id, you can be more confident in a quick skim of the code that we're not mutating anything in the "sub".
This commit is contained in:
@@ -99,7 +99,7 @@ exports.mark_subscribed = function (sub, subscribers, color) {
|
||||
}
|
||||
stream_data.subscribe_myself(sub);
|
||||
if (subscribers) {
|
||||
peer_data.set_subscribers(sub, subscribers);
|
||||
peer_data.set_subscribers(sub.stream_id, subscribers);
|
||||
}
|
||||
stream_data.update_calculated_fields(sub);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user