@@ -487,19 +487,6 @@ class PerAccountStore extends PerAccountStoreBase with
487
487
core: core,
488
488
groups: UserGroupStoreImpl (core: core,
489
489
groups: initialSnapshot.realmUserGroups),
490
- serverPresencePingIntervalSeconds: initialSnapshot.serverPresencePingIntervalSeconds,
491
- serverPresenceOfflineThresholdSeconds: initialSnapshot.serverPresenceOfflineThresholdSeconds,
492
- realmWildcardMentionPolicy: initialSnapshot.realmWildcardMentionPolicy,
493
- realmMandatoryTopics: initialSnapshot.realmMandatoryTopics,
494
- realmWaitingPeriodThreshold: initialSnapshot.realmWaitingPeriodThreshold,
495
- realmPresenceDisabled: initialSnapshot.realmPresenceDisabled,
496
- maxFileUploadSizeMib: initialSnapshot.maxFileUploadSizeMib,
497
- realmEmptyTopicDisplayName: initialSnapshot.realmEmptyTopicDisplayName,
498
- realmAllowMessageEditing: initialSnapshot.realmAllowMessageEditing,
499
- realmMessageContentEditLimitSeconds: initialSnapshot.realmMessageContentEditLimitSeconds,
500
- realmDefaultExternalAccounts: initialSnapshot.realmDefaultExternalAccounts,
501
- customProfileFields: _sortCustomProfileFields (initialSnapshot.customProfileFields),
502
- emailAddressVisibility: initialSnapshot.emailAddressVisibility,
503
490
realm: RealmStoreImpl (core: core, initialSnapshot: initialSnapshot),
504
491
emoji: EmojiStoreImpl (
505
492
core: core, allRealmEmoji: initialSnapshot.realmEmoji),
@@ -538,19 +525,6 @@ class PerAccountStore extends PerAccountStoreBase with
538
525
PerAccountStore ._({
539
526
required super .core,
540
527
required UserGroupStoreImpl groups,
541
- required this .serverPresencePingIntervalSeconds,
542
- required this .serverPresenceOfflineThresholdSeconds,
543
- required this .realmWildcardMentionPolicy,
544
- required this .realmMandatoryTopics,
545
- required this .realmWaitingPeriodThreshold,
546
- required this .realmPresenceDisabled,
547
- required this .maxFileUploadSizeMib,
548
- required String ? realmEmptyTopicDisplayName,
549
- required this .realmAllowMessageEditing,
550
- required this .realmMessageContentEditLimitSeconds,
551
- required this .realmDefaultExternalAccounts,
552
- required this .customProfileFields,
553
- required this .emailAddressVisibility,
554
528
required RealmStoreImpl realm,
555
529
required EmojiStoreImpl emoji,
556
530
required this .userSettings,
@@ -565,7 +539,6 @@ class PerAccountStore extends PerAccountStoreBase with
565
539
required this .recentDmConversationsView,
566
540
required this .recentSenders,
567
541
}) : _groups = groups,
568
- _realmEmptyTopicDisplayName = realmEmptyTopicDisplayName,
569
542
_realm = realm,
570
543
_emoji = emoji,
571
544
_savedSnippets = savedSnippets,
@@ -606,36 +579,34 @@ class PerAccountStore extends PerAccountStoreBase with
606
579
UserGroupStore get userGroupStore => _groups;
607
580
final UserGroupStoreImpl _groups;
608
581
609
- final int serverPresencePingIntervalSeconds;
610
- final int serverPresenceOfflineThresholdSeconds;
611
-
612
- final RealmWildcardMentionPolicy realmWildcardMentionPolicy; // TODO(#668): update this realm setting
613
- final bool realmMandatoryTopics; // TODO(#668): update this realm setting
614
- /// For docs, please see [InitialSnapshot.realmWaitingPeriodThreshold] .
615
- final int realmWaitingPeriodThreshold; // TODO(#668): update this realm setting
616
- final bool realmAllowMessageEditing; // TODO(#668): update this realm setting
617
- final int ? realmMessageContentEditLimitSeconds; // TODO(#668): update this realm setting
618
- final bool realmPresenceDisabled; // TODO(#668): update this realm setting
619
- final int maxFileUploadSizeMib; // No event for this.
620
-
621
- /// The display name to use for empty topics.
622
- ///
623
- /// This should only be accessed when FL >= 334, since topics cannot
624
- /// be empty otherwise.
625
- // TODO(server-10) simplify this
626
- String get realmEmptyTopicDisplayName {
627
- assert (zulipFeatureLevel >= 334 );
628
- assert (_realmEmptyTopicDisplayName != null ); // TODO(log)
629
- return _realmEmptyTopicDisplayName ?? 'general chat' ;
630
- }
631
- final String ? _realmEmptyTopicDisplayName; // TODO(#668): update this realm setting
632
-
633
- final Map <String , RealmDefaultExternalAccount > realmDefaultExternalAccounts;
634
- List <CustomProfileField > customProfileFields;
635
- /// For docs, please see [InitialSnapshot.emailAddressVisibility] .
636
- final EmailAddressVisibility ? emailAddressVisibility; // TODO(#668): update this realm setting
582
+ @override
583
+ int get serverPresencePingIntervalSeconds => _realm.serverPresencePingIntervalSeconds;
584
+ @override
585
+ int get serverPresenceOfflineThresholdSeconds => _realm.serverPresenceOfflineThresholdSeconds;
586
+ @override
587
+ RealmWildcardMentionPolicy get realmWildcardMentionPolicy => _realm.realmWildcardMentionPolicy;
588
+ @override
589
+ bool get realmMandatoryTopics => _realm.realmMandatoryTopics;
590
+ @override
591
+ int get realmWaitingPeriodThreshold => _realm.realmWaitingPeriodThreshold;
592
+ @override
593
+ bool get realmAllowMessageEditing => _realm.realmAllowMessageEditing;
594
+ @override
595
+ int ? get realmMessageContentEditLimitSeconds => _realm.realmMessageContentEditLimitSeconds;
596
+ @override
597
+ bool get realmPresenceDisabled => _realm.realmPresenceDisabled;
598
+ @override
599
+ int get maxFileUploadSizeMib => _realm.maxFileUploadSizeMib;
600
+ @override
601
+ String get realmEmptyTopicDisplayName => _realm.realmEmptyTopicDisplayName;
602
+ @override
603
+ Map <String , RealmDefaultExternalAccount > get realmDefaultExternalAccounts => _realm.realmDefaultExternalAccounts;
604
+ @override
605
+ List <CustomProfileField > get customProfileFields => _realm.customProfileFields;
606
+ @override
607
+ EmailAddressVisibility ? get emailAddressVisibility => _realm.emailAddressVisibility;
637
608
638
- final RealmStoreImpl _realm; // ignore: unused_field // TODO
609
+ final RealmStoreImpl _realm;
639
610
640
611
////////////////////////////////
641
612
// The realm's repertoire of available emoji.
@@ -930,7 +901,7 @@ class PerAccountStore extends PerAccountStoreBase with
930
901
931
902
case CustomProfileFieldsEvent ():
932
903
assert (debugLog ("server event: custom_profile_fields" ));
933
- customProfileFields = _sortCustomProfileFields (event.fields );
904
+ _realm. handleCustomProfileFieldsEvent (event);
934
905
notifyListeners ();
935
906
936
907
case UserGroupEvent ():
@@ -1043,21 +1014,6 @@ class PerAccountStore extends PerAccountStoreBase with
1043
1014
}
1044
1015
}
1045
1016
1046
- static List <CustomProfileField > _sortCustomProfileFields (List <CustomProfileField > initialCustomProfileFields) {
1047
- // TODO(server): The realm-wide field objects have an `order` property,
1048
- // but the actual API appears to be that the fields should be shown in
1049
- // the order they appear in the array (`custom_profile_fields` in the
1050
- // API; our `realmFields` array here.) See chat thread:
1051
- // https://chat.zulip.org/#narrow/stream/378-api-design/topic/custom.20profile.20fields/near/1382982
1052
- //
1053
- // We go on to put at the start of the list any fields that are marked for
1054
- // displaying in the "profile summary". (Possibly they should be at the
1055
- // start of the list in the first place, but make sure just in case.)
1056
- final displayFields = initialCustomProfileFields.where ((e) => e.displayInProfileSummary == true );
1057
- final nonDisplayFields = initialCustomProfileFields.where ((e) => e.displayInProfileSummary != true );
1058
- return displayFields.followedBy (nonDisplayFields).toList ();
1059
- }
1060
-
1061
1017
@override
1062
1018
String toString () => '${objectRuntimeType (this , 'PerAccountStore' )}#${shortHash (this )}' ;
1063
1019
}
0 commit comments