Skip to content

Commit 89397f0

Browse files
committed
initial data types: Sync InitialDataUserSettings with the doc at FL 152
1 parent 43acc41 commit 89397f0

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

src/__tests__/lib/exampleData.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,7 @@ export const action = Object.freeze({
914914
left_side_userlist: false,
915915
emojiset: 'google',
916916
demote_inactive_streams: 2,
917+
user_list_style: 1,
917918
timezone: selfUser.timezone ?? 'UTC',
918919
enter_sends: false,
919920
enable_drafts_synchronization: true,

src/api/initialDataTypes.js

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,14 @@ export type InitialDataUpdateMessageFlags = $ReadOnly<{|
598598
|}>,
599599
|}>;
600600

601+
// Assumes FL 89+, because servers added user_settings to the /register
602+
// response in FL 89.
603+
//
604+
// Current to FL 152; property ordering follows the /register doc. See the
605+
// "Current to" note on the InitialDataUserSettings type and update that as
606+
// needed too.
607+
//
608+
// TODO(server-5.0): Remove FL 89+ comment.
601609
export type UserSettings = {|
602610
+twenty_four_hour_time: boolean,
603611
+dense_mode: boolean,
@@ -611,14 +619,18 @@ export type UserSettings = {|
611619
+display_emoji_reaction_users?: boolean,
612620

613621
+default_language: string,
614-
+default_view: string,
622+
+default_view: 'recent_topics' | 'all_messages',
615623

616624
// TODO(server-5.0): New in FL 107.
617625
+escape_navigates_to_default_view?: boolean,
618626

619627
+left_side_userlist: boolean,
620628
+emojiset: 'google' | 'google-blob' | 'twitter' | 'text',
621629
+demote_inactive_streams: 1 | 2 | 3,
630+
631+
// TODO(server-6.0): New in FL 141.
632+
+user_list_style: 1 | 2 | 3,
633+
622634
+timezone: string,
623635
+enter_sends: boolean,
624636
+enable_drafts_synchronization: boolean,
@@ -660,9 +672,14 @@ export type UserSettings = {|
660672
*
661673
* Replaces various toplevel properties in the register response; see #4933.
662674
*/
663-
// Current to FL 129; property ordering follows the doc.
675+
// Assumes FL 89+ because this was added in FL 89.
676+
//
677+
// Current to FL 152. See the "Current to" note on the UserSettings type and
678+
// update that as needed too.
679+
//
680+
// TODO(server-5.0): Remove FL 89+ comment.
664681
export type InitialDataUserSettings = {|
665-
// TODO(server-5.0): New in FL 89, for requesting clients.
682+
// TODO(server-5.0): New in FL 89, for requesting clients, so assumes 89.
666683
+user_settings?: UserSettings,
667684
|};
668685

0 commit comments

Comments
 (0)