events: Remove name field from update subscription events.

This commit removes name field from update subscription
events, as it is not used by any of the clients, and use
stream_id in the events code instead.
This commit is contained in:
sahil839 2021-03-06 17:50:32 +05:30 committed by Tim Abbott
parent 189e86e18e
commit 9a432b0c3b
7 changed files with 7 additions and 10 deletions

View File

@ -562,7 +562,6 @@ exports.fixtures = {
subscription__update: {
type: "subscription",
op: "update",
name: streams.devel.name,
stream_id: streams.devel.stream_id,
property: "pin_to_top",
value: true,

View File

@ -10,6 +10,11 @@ below features are supported.
## Changes in Zulip 4.0
**Feature level 41**
* [`GET /events`](/api/get-events): Remove name field from update
subscription events.
**Feature level 40**
* [`GET /events`](/api/get-events): Remove email field from update

View File

@ -30,7 +30,7 @@ DESKTOP_WARNING_VERSION = "5.2.0"
#
# Changes should be accompanied by documentation explaining what the
# new level means in templates/zerver/api/changelog.md.
API_FEATURE_LEVEL = 40
API_FEATURE_LEVEL = 41
# Bump the minor PROVISION_VERSION to indicate that folks should provision
# only when going from an old version of the code to a newer version. Bump

View File

@ -3700,7 +3700,6 @@ def do_change_subscription_property(
property=event_property_name,
value=event_value,
stream_id=stream.id,
name=stream.name,
)
send_event(user_profile.realm, event, [user_profile.id])

View File

@ -1225,7 +1225,6 @@ subscription_update_event = event_dict_type(
("property", str),
("stream_id", int),
("value", value_type),
("name", str),
]
)
_check_subscription_update = make_checker(subscription_update_event)

View File

@ -783,7 +783,7 @@ def apply_event(
elif event["op"] == "update":
for sub in state["subscriptions"]:
if sub["name"].lower() == event["name"].lower():
if sub["stream_id"] == event["stream_id"]:
sub[event["property"]] = event["value"]
elif event["op"] == "peer_add":
if include_subscribers:

View File

@ -580,10 +580,6 @@ paths:
type: integer
description: |
The ID of the stream whose subscription details have changed.
name:
type: string
description: |
The name of the stream whose subscription details have changed.
property:
type: string
description: |
@ -609,7 +605,6 @@ paths:
"property": "pin_to_top",
"value": true,
"stream_id": 11,
"name": "test_stream",
"id": 0,
}
- type: object