Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tests/model/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,13 @@ def test_init_user_settings(self, mocker, initial_data, sptn, expected_sptn_valu
assert "user_settings" not in initial_data # we add it in tests

if sptn is not None:
initial_data["user_settings"] = {"send_private_typing_notifications": sptn}
initial_data["user_settings"] = {
"send_private_typing_notifications": sptn,
"twenty_four_hour_time": initial_data["twenty_four_hour_time"],
"pm_content_in_desktop_notifications": initial_data[
"pm_content_in_desktop_notifications"
],
}

mocker.patch(MODEL + ".get_messages", return_value="")
self.client.register = mocker.Mock(return_value=initial_data)
Expand Down
15 changes: 11 additions & 4 deletions zulipterminal/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,17 @@ def __init__(self, controller: Any) -> None:
if user_settings is None
else user_settings["send_private_typing_notifications"]
), # ZFL 105, Zulip 5.0
twenty_four_hour_time=self.initial_data["twenty_four_hour_time"],
pm_content_in_desktop_notifications=self.initial_data[
"pm_content_in_desktop_notifications"
],
# these settings were removed from the top-level object in ZFL 439 (v12.0)
twenty_four_hour_time=(
self.initial_data["twenty_four_hour_time"]
if user_settings is None
else user_settings["twenty_four_hour_time"]
),
pm_content_in_desktop_notifications=(
self.initial_data["pm_content_in_desktop_notifications"]
if user_settings is None
else user_settings["pm_content_in_desktop_notifications"]
),
)

self.new_user_input = True
Expand Down
Loading