Skip to content

Commit cce7632

Browse files
committed
realm: Add realm-level restrict-message-deleting fields to RealmStore
1 parent 626ab15 commit cce7632

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

lib/api/model/initial_snapshot.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ class InitialSnapshot {
7979
/// The policy for who can delete their own messages,
8080
/// on supported servers below version 10.
8181
///
82-
/// Removed in FL 291.
82+
/// Removed in FL 291, so absent in the current API doc;
83+
/// see zulip/zulip@0cd51f2fe.
8384
final RealmDeleteOwnMessagePolicy? realmDeleteOwnMessagePolicy; // TODO(server-10)
8485

8586
/// The policy for who can use wildcard mentions in large channels.

lib/model/realm.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@ mixin RealmStore on PerAccountStoreBase, UserGroupStore {
4242
// TODO(#668): update all these realm settings on events.
4343

4444
bool get realmAllowMessageEditing;
45+
GroupSettingValue? get realmCanDeleteAnyMessageGroup; // TODO(server-10)
46+
GroupSettingValue? get realmCanDeleteOwnMessageGroup; // TODO(server-10)
4547
bool get realmEnableReadReceipts;
4648
bool get realmMandatoryTopics;
4749
int get maxFileUploadSizeMib;
50+
int? get realmMessageContentDeleteLimitSeconds;
4851
Duration? get realmMessageContentEditLimit =>
4952
realmMessageContentEditLimitSeconds == null ? null
5053
: Duration(seconds: realmMessageContentEditLimitSeconds!);
@@ -57,6 +60,7 @@ mixin RealmStore on PerAccountStoreBase, UserGroupStore {
5760
// but now deprecated.
5861

5962
RealmWildcardMentionPolicy get realmWildcardMentionPolicy; // TODO(#662): replaced by can_mention_many_users_group
63+
RealmDeleteOwnMessagePolicy? get realmDeleteOwnMessagePolicy; // TODO(server-10) remove
6064

6165
//|//////////////////////////////
6266
// Realm settings that lack events.
@@ -148,12 +152,18 @@ mixin ProxyRealmStore on RealmStore {
148152
@override
149153
bool get realmAllowMessageEditing => realmStore.realmAllowMessageEditing;
150154
@override
155+
GroupSettingValue? get realmCanDeleteAnyMessageGroup => realmStore.realmCanDeleteAnyMessageGroup;
156+
@override
157+
GroupSettingValue? get realmCanDeleteOwnMessageGroup => realmStore.realmCanDeleteOwnMessageGroup;
158+
@override
151159
bool get realmEnableReadReceipts => realmStore.realmEnableReadReceipts;
152160
@override
153161
bool get realmMandatoryTopics => realmStore.realmMandatoryTopics;
154162
@override
155163
int get maxFileUploadSizeMib => realmStore.maxFileUploadSizeMib;
156164
@override
165+
int? get realmMessageContentDeleteLimitSeconds => realmStore.realmMessageContentDeleteLimitSeconds;
166+
@override
157167
int? get realmMessageContentEditLimitSeconds => realmStore.realmMessageContentEditLimitSeconds;
158168
@override
159169
bool get realmPresenceDisabled => realmStore.realmPresenceDisabled;
@@ -162,6 +172,8 @@ mixin ProxyRealmStore on RealmStore {
162172
@override
163173
RealmWildcardMentionPolicy get realmWildcardMentionPolicy => realmStore.realmWildcardMentionPolicy;
164174
@override
175+
RealmDeleteOwnMessagePolicy? get realmDeleteOwnMessagePolicy => realmStore.realmDeleteOwnMessagePolicy;
176+
@override
165177
String get realmEmptyTopicDisplayName => realmStore.realmEmptyTopicDisplayName;
166178
@override
167179
Map<String, RealmDefaultExternalAccount> get realmDefaultExternalAccounts => realmStore.realmDefaultExternalAccounts;
@@ -197,13 +209,17 @@ class RealmStoreImpl extends HasUserGroupStore with RealmStore {
197209
serverTypingStoppedWaitPeriodMilliseconds = initialSnapshot.serverTypingStoppedWaitPeriodMilliseconds,
198210
serverTypingStartedWaitPeriodMilliseconds = initialSnapshot.serverTypingStartedWaitPeriodMilliseconds,
199211
realmAllowMessageEditing = initialSnapshot.realmAllowMessageEditing,
212+
realmCanDeleteAnyMessageGroup = initialSnapshot.realmCanDeleteAnyMessageGroup,
213+
realmCanDeleteOwnMessageGroup = initialSnapshot.realmCanDeleteOwnMessageGroup,
200214
realmMandatoryTopics = initialSnapshot.realmMandatoryTopics,
201215
maxFileUploadSizeMib = initialSnapshot.maxFileUploadSizeMib,
216+
realmMessageContentDeleteLimitSeconds = initialSnapshot.realmMessageContentDeleteLimitSeconds,
202217
realmMessageContentEditLimitSeconds = initialSnapshot.realmMessageContentEditLimitSeconds,
203218
realmEnableReadReceipts = initialSnapshot.realmEnableReadReceipts,
204219
realmPresenceDisabled = initialSnapshot.realmPresenceDisabled,
205220
realmWaitingPeriodThreshold = initialSnapshot.realmWaitingPeriodThreshold,
206221
realmWildcardMentionPolicy = initialSnapshot.realmWildcardMentionPolicy,
222+
realmDeleteOwnMessagePolicy = initialSnapshot.realmDeleteOwnMessagePolicy,
207223
_realmEmptyTopicDisplayName = initialSnapshot.realmEmptyTopicDisplayName,
208224
realmDefaultExternalAccounts = initialSnapshot.realmDefaultExternalAccounts,
209225
customProfileFields = _sortCustomProfileFields(initialSnapshot.customProfileFields);
@@ -263,12 +279,18 @@ class RealmStoreImpl extends HasUserGroupStore with RealmStore {
263279
@override
264280
final bool realmAllowMessageEditing;
265281
@override
282+
final GroupSettingValue? realmCanDeleteAnyMessageGroup;
283+
@override
284+
final GroupSettingValue? realmCanDeleteOwnMessageGroup;
285+
@override
266286
final bool realmEnableReadReceipts;
267287
@override
268288
final bool realmMandatoryTopics;
269289
@override
270290
final int maxFileUploadSizeMib;
271291
@override
292+
final int? realmMessageContentDeleteLimitSeconds;
293+
@override
272294
final int? realmMessageContentEditLimitSeconds;
273295
@override
274296
final bool realmPresenceDisabled;
@@ -277,6 +299,8 @@ class RealmStoreImpl extends HasUserGroupStore with RealmStore {
277299

278300
@override
279301
final RealmWildcardMentionPolicy realmWildcardMentionPolicy;
302+
@override
303+
final RealmDeleteOwnMessagePolicy? realmDeleteOwnMessagePolicy;
280304

281305
@override
282306
String get realmEmptyTopicDisplayName {

0 commit comments

Comments
 (0)