Skip to content

Commit fc3db42

Browse files
committed
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.
1 parent 03f385a commit fc3db42

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/api/model/events.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ class ChannelUpdateEvent extends ChannelEvent {
433433
return ChannelPostPolicy.fromApiValue(value as int);
434434
case ChannelPropertyName.canRemoveSubscribersGroup:
435435
case ChannelPropertyName.canRemoveSubscribersGroupId:
436+
return value as int;
436437
case ChannelPropertyName.streamWeeklyTraffic:
437438
return value as int?;
438439
case null:

0 commit comments

Comments
 (0)