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:
Steve Howell
2021-01-13 21:03:25 +00:00
committed by Tim Abbott
parent 6cc880c858
commit 355f44ef13
8 changed files with 19 additions and 20 deletions

View File

@@ -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);