Skip to content

Commit

Permalink
api: Tighten value type on ChannelUpdateEvent for canRemoveSubscriber…
Browse files Browse the repository at this point in the history
…sGroup

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.
  • Loading branch information
gnprice committed Aug 21, 2024
1 parent 03f385a commit fc3db42
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/api/model/events.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit fc3db42

Please sign in to comment.