From fc3db42c8e3eced8e404e9ffac8540a477854c30 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Wed, 21 Aug 2024 14:27:36 -0700 Subject: [PATCH] api: Tighten value type on ChannelUpdateEvent for canRemoveSubscribersGroup This property on streams/channels is documented as type "integer": https://zulip.com/api/get-streams#response (And the same goes for its former name of canRemoveSubscribersGroupId.) So when the server supports this property at all, and therefore might send us an event for it, the value it supplies will be non-null. The corresponding field on ZulipStream is nullable only because of servers that don't yet support the property. --- lib/api/model/events.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/api/model/events.dart b/lib/api/model/events.dart index 3bd5ac72fc..6d5fde6895 100644 --- a/lib/api/model/events.dart +++ b/lib/api/model/events.dart @@ -433,6 +433,7 @@ class ChannelUpdateEvent extends ChannelEvent { return ChannelPostPolicy.fromApiValue(value as int); case ChannelPropertyName.canRemoveSubscribersGroup: case ChannelPropertyName.canRemoveSubscribersGroupId: + return value as int; case ChannelPropertyName.streamWeeklyTraffic: return value as int?; case null: