mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 23:13:25 +00:00
home: Get pm_content_in_desktop_notifications from register_ret.
This commit is contained in:
@@ -172,6 +172,7 @@ def fetch_initial_state_data(user_profile, event_types, queue_id,
|
|||||||
state['enable_offline_push_notifications'] = user_profile.enable_offline_push_notifications
|
state['enable_offline_push_notifications'] = user_profile.enable_offline_push_notifications
|
||||||
state['enable_online_push_notifications'] = user_profile.enable_online_push_notifications
|
state['enable_online_push_notifications'] = user_profile.enable_online_push_notifications
|
||||||
state['enable_digest_emails'] = user_profile.enable_digest_emails
|
state['enable_digest_emails'] = user_profile.enable_digest_emails
|
||||||
|
state['pm_content_in_desktop_notifications'] = user_profile.pm_content_in_desktop_notifications
|
||||||
|
|
||||||
if want('zulip_version'):
|
if want('zulip_version'):
|
||||||
state['zulip_version'] = ZULIP_VERSION
|
state['zulip_version'] = ZULIP_VERSION
|
||||||
@@ -438,6 +439,8 @@ def apply_event(state, event, user_profile, include_subscribers):
|
|||||||
state['enable_online_push_notifications'] = event['setting']
|
state['enable_online_push_notifications'] = event['setting']
|
||||||
elif event['notification_name'] == "enable_digest_emails":
|
elif event['notification_name'] == "enable_digest_emails":
|
||||||
state['enable_digest_emails'] = event['setting']
|
state['enable_digest_emails'] = event['setting']
|
||||||
|
elif event['notification_name'] == "pm_content_in_desktop_notifications":
|
||||||
|
state['pm_content_in_desktop_notifications'] = event['setting']
|
||||||
else:
|
else:
|
||||||
raise AssertionError("Unexpected event type %s" % (event['type'],))
|
raise AssertionError("Unexpected event type %s" % (event['type'],))
|
||||||
|
|
||||||
|
|||||||
@@ -1151,7 +1151,6 @@ class EventsRegisterTest(ZulipTestCase):
|
|||||||
lambda: do_change_pm_content_in_desktop_notifications(self.user_profile,
|
lambda: do_change_pm_content_in_desktop_notifications(self.user_profile,
|
||||||
setting_value,
|
setting_value,
|
||||||
log=False),
|
log=False),
|
||||||
state_change_expected=False,
|
|
||||||
)
|
)
|
||||||
error = schema_checker('events[0]', events[0])
|
error = schema_checker('events[0]', events[0])
|
||||||
self.assert_on_error(error)
|
self.assert_on_error(error)
|
||||||
|
|||||||
@@ -224,7 +224,6 @@ def home_real(request):
|
|||||||
|
|
||||||
# Private message and @-mention notification settings:
|
# Private message and @-mention notification settings:
|
||||||
desktop_notifications_enabled = desktop_notifications_enabled,
|
desktop_notifications_enabled = desktop_notifications_enabled,
|
||||||
pm_content_in_desktop_notifications = user_profile.pm_content_in_desktop_notifications,
|
|
||||||
|
|
||||||
# Realm foreign key data from register_ret.
|
# Realm foreign key data from register_ret.
|
||||||
# TODO: Rename these to match register_ret values.
|
# TODO: Rename these to match register_ret values.
|
||||||
@@ -270,6 +269,7 @@ def home_real(request):
|
|||||||
'max_message_id',
|
'max_message_id',
|
||||||
'muted_topics',
|
'muted_topics',
|
||||||
'never_subscribed',
|
'never_subscribed',
|
||||||
|
'pm_content_in_desktop_notifications',
|
||||||
'presences',
|
'presences',
|
||||||
'queue_id',
|
'queue_id',
|
||||||
'realm_add_emoji_by_admins_only',
|
'realm_add_emoji_by_admins_only',
|
||||||
|
|||||||
Reference in New Issue
Block a user