Skip to content

Commit b73fe76

Browse files
author
chimnayajith
committed
api: Add realmName and realmIcon in intial snapshot
1 parent 449f326 commit b73fe76

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

lib/api/model/initial_snapshot.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class InitialSnapshot {
7171

7272
final bool realmMandatoryTopics;
7373

74+
final String realmName;
7475
/// The number of days until a user's account is treated as a full member.
7576
///
7677
/// Search for "realm_waiting_period_threshold" in https://zulip.com/api/register-queue.
@@ -81,6 +82,8 @@ class InitialSnapshot {
8182

8283
final Map<String, RealmDefaultExternalAccount> realmDefaultExternalAccounts;
8384

85+
final String realmIconUrl;
86+
8487
final int maxFileUploadSizeMib;
8588

8689
final Uri? serverEmojiDataUrl; // TODO(server-6)
@@ -134,8 +137,10 @@ class InitialSnapshot {
134137
required this.userTopics,
135138
required this.realmWildcardMentionPolicy,
136139
required this.realmMandatoryTopics,
140+
required this.realmName,
137141
required this.realmWaitingPeriodThreshold,
138142
required this.realmDefaultExternalAccounts,
143+
required this.realmIconUrl,
139144
required this.maxFileUploadSizeMib,
140145
required this.serverEmojiDataUrl,
141146
required this.realmUsers,

lib/api/model/initial_snapshot.g.dart

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

test/example_data.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,10 +856,12 @@ InitialSnapshot initialSnapshot({
856856
List<ZulipStream>? streams,
857857
UserSettings? userSettings,
858858
List<UserTopicItem>? userTopics,
859+
String? realmName,
859860
RealmWildcardMentionPolicy? realmWildcardMentionPolicy,
860861
bool? realmMandatoryTopics,
861862
int? realmWaitingPeriodThreshold,
862863
Map<String, RealmDefaultExternalAccount>? realmDefaultExternalAccounts,
864+
String? realmIconUrl,
863865
int? maxFileUploadSizeMib,
864866
Uri? serverEmojiDataUrl,
865867
List<User>? realmUsers,
@@ -892,10 +894,12 @@ InitialSnapshot initialSnapshot({
892894
emojiset: Emojiset.google,
893895
),
894896
userTopics: userTopics,
897+
realmName: realmName ?? "Example Name",
895898
realmWildcardMentionPolicy: realmWildcardMentionPolicy ?? RealmWildcardMentionPolicy.everyone,
896899
realmMandatoryTopics: realmMandatoryTopics ?? true,
897900
realmWaitingPeriodThreshold: realmWaitingPeriodThreshold ?? 0,
898901
realmDefaultExternalAccounts: realmDefaultExternalAccounts ?? {},
902+
realmIconUrl: realmIconUrl ?? "https://example.com/image.png",
899903
maxFileUploadSizeMib: maxFileUploadSizeMib ?? 25,
900904
serverEmojiDataUrl: serverEmojiDataUrl
901905
?? realmUrl.replace(path: '/static/emoji.json'),

0 commit comments

Comments
 (0)