Fix buggy application of subscription update events.

(imported from commit 4c76dc3ee5d3d1a298591c0c60dbe0e3aa30e0af)
This commit is contained in:
Tim Abbott 2013-08-27 19:12:20 -04:00
parent 77dbbe7f23
commit 648e85160d
1 changed files with 2 additions and 1 deletions

View File

@ -1190,7 +1190,8 @@ def do_events_register(user_profile, user_client, apply_markdown=True,
if event['op'] == "add" or event['op'] == "update": if event['op'] == "add" or event['op'] == "update":
ret['realm_users'].append(event['person']) ret['realm_users'].append(event['person'])
elif event['type'] == "subscriptions": elif event['type'] == "subscriptions":
subscriptions_to_filter = set(sub.name.lower() for sub in event["subscriptions"]) if event['op'] in ["add", "remove"]:
subscriptions_to_filter = set(sub.name.lower() for sub in event["subscriptions"])
# We add the new subscriptions to the list of streams the # We add the new subscriptions to the list of streams the
# user is subscribed to, and also remove/add them from the # user is subscribed to, and also remove/add them from the
# list of streams the user is not subscribed to (which we # list of streams the user is not subscribed to (which we