Skip to content

Commit 2705e47

Browse files
committed
api [nfc]: Rename streamPostPolicy to channelPostPolicy in Channel
Fixes parts of zulip#631
1 parent b15d7f5 commit 2705e47

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

lib/api/model/model.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ class Channel {
319319
final bool historyPublicToSubscribers;
320320
final int? messageRetentionDays;
321321

322-
final StreamPostPolicy streamPostPolicy;
323-
// final bool isAnnouncementOnly; // deprecated for `streamPostPolicy`; ignore
322+
final StreamPostPolicy channelPostPolicy;
323+
// final bool isAnnouncementOnly; // deprecated for `channelPostPolicy`; ignore
324324

325325
// TODO(server-6): `canRemoveSubscribersGroupId` added in FL 142
326326
// TODO(server-8): in FL 197 renamed to `canRemoveSubscribersGroup`
@@ -346,7 +346,7 @@ class Channel {
346346
required this.isWebPublic,
347347
required this.historyPublicToSubscribers,
348348
required this.messageRetentionDays,
349-
required this.streamPostPolicy,
349+
required this.channelPostPolicy,
350350
required this.canRemoveSubscribersGroup,
351351
required this.streamWeeklyTraffic,
352352
});
@@ -417,7 +417,7 @@ class Subscription extends Channel {
417417
required super.isWebPublic,
418418
required super.historyPublicToSubscribers,
419419
required super.messageRetentionDays,
420-
required super.streamPostPolicy,
420+
required super.channelPostPolicy,
421421
required super.canRemoveSubscribersGroup,
422422
required super.streamWeeklyTraffic,
423423
required this.desktopNotifications,

lib/api/model/model.g.dart

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/api/model/model_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ void main() {
7878
'is_web_public': false,
7979
'history_public_to_subscribers': true,
8080
'message_retention_days': null,
81-
'stream_post_policy': StreamPostPolicy.any.apiValue,
81+
'channel_post_policy': StreamPostPolicy.any.apiValue,
8282
// 'can_remove_subscribers_group': null,
8383
'stream_weekly_traffic': null,
8484
});

test/example_data.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Channel stream({
160160
bool? isWebPublic,
161161
bool? historyPublicToSubscribers,
162162
int? messageRetentionDays,
163-
StreamPostPolicy? streamPostPolicy,
163+
StreamPostPolicy? channelPostPolicy,
164164
int? canRemoveSubscribersGroup,
165165
int? streamWeeklyTraffic,
166166
}) {
@@ -175,7 +175,7 @@ Channel stream({
175175
isWebPublic: isWebPublic ?? false,
176176
historyPublicToSubscribers: historyPublicToSubscribers ?? true,
177177
messageRetentionDays: messageRetentionDays,
178-
streamPostPolicy: streamPostPolicy ?? StreamPostPolicy.any,
178+
channelPostPolicy: channelPostPolicy ?? StreamPostPolicy.any,
179179
canRemoveSubscribersGroup: canRemoveSubscribersGroup ?? 123,
180180
streamWeeklyTraffic: streamWeeklyTraffic,
181181
);
@@ -208,7 +208,7 @@ Subscription subscription(
208208
isWebPublic: stream.isWebPublic,
209209
historyPublicToSubscribers: stream.historyPublicToSubscribers,
210210
messageRetentionDays: stream.messageRetentionDays,
211-
streamPostPolicy: stream.streamPostPolicy,
211+
channelPostPolicy: stream.channelPostPolicy,
212212
canRemoveSubscribersGroup: stream.canRemoveSubscribersGroup,
213213
streamWeeklyTraffic: stream.streamWeeklyTraffic,
214214
desktopNotifications: desktopNotifications ?? false,

0 commit comments

Comments
 (0)