Use stream_id as key for subscription removals.

Have the server send down the stream's id for removal
events, and have the client use that id to look up the
stream in its internal data structures.  This sets the
stage for eventually just sending the stream id (and not
the stream name) down to clients, once all our clients
are ready to use the stream id.

(imported from commit 922516c98fb79ffad8ae7da0396646663ca54fd0)
This commit is contained in:
Steve Howell
2014-02-07 13:06:02 -05:00
committed by Tim Abbott
parent 194464f596
commit 72ee636571
4 changed files with 6 additions and 4 deletions

View File

@@ -1054,7 +1054,7 @@ def notify_subscriptions_removed(user_profile, streams, no_log=False):
'names': [stream.name for stream in streams],
'domain': stream.realm.domain})
payload = [dict(name=stream.name) for stream in streams]
payload = [dict(name=stream.name, stream_id=stream.id) for stream in streams]
event = dict(type="subscription", op="remove",
subscriptions=payload)
send_event(event, [user_profile.id])