From 3a96686cbcd04db1647c7f06a3fd62a3e0834ea0 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Wed, 5 Feb 2014 13:58:41 -0500 Subject: [PATCH] Add stream_id to page_params.{subscriptions,unsubscribed} This isn't used by the client yet, but it should be harmless. (imported from commit e09ac65ca802f5cf16375b8a93d34e0dfbcb76b4) --- static/js/subs.js | 1 + zerver/lib/actions.py | 2 ++ zerver/test_events.py | 1 + 3 files changed, 4 insertions(+) diff --git a/static/js/subs.js b/static/js/subs.js index 0ef2e01775..8bf1cbebbf 100644 --- a/static/js/subs.js +++ b/static/js/subs.js @@ -358,6 +358,7 @@ function populate_subscriptions(subs, subscribed) { invite_only: elem.invite_only, notifications: elem.notifications, subscribed: subscribed, email_address: elem.email_address, + stream_id: elem.stream_id, subscribers: elem.subscribers, description: elem.description}); sub_rows.push(sub); diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index f8ba4f8e9c..3e7d6cd1d3 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -897,6 +897,7 @@ def notify_subscriptions_added(user_profile, sub_pairs, stream_emails, no_log=Fa # Send a notification to the user who subscribed. payload = [dict(name=stream.name, + stream_id=stream.id, in_home_view=subscription.in_home_view, invite_only=stream.invite_only, color=subscription.color, @@ -1912,6 +1913,7 @@ def gather_subscriptions_helper(user_profile): 'invite_only': stream["invite_only"], 'color': sub["color"], 'notifications': sub["notifications"], + 'stream_id': stream["id"], 'description': stream["description"], 'email_address': encode_email_address_helper(stream["name"], stream["email_token"])} if subscribers is not None: diff --git a/zerver/test_events.py b/zerver/test_events.py index 8d9d452eac..6d92f42625 100644 --- a/zerver/test_events.py +++ b/zerver/test_events.py @@ -280,6 +280,7 @@ class EventsRegisterTest(AuthedTestCase): ('in_home_view', check_bool), ('name', check_string), ('notifications', check_bool), + ('stream_id', check_int), ('subscribers', check_list(check_int)), ]) )