events: Migrate to typed_endpoint.

Migrate `event_register.py` and `tornado` to typed_endpoint.
Modified the tests to work with the migrated endpoints.
This commit is contained in:
Kenneth Rodrigues
2024-07-30 13:50:01 +05:30
committed by Tim Abbott
parent 4e63daf2ce
commit 97f15d8811
6 changed files with 148 additions and 138 deletions

View File

@@ -8,7 +8,7 @@ from django.utils import translation
from two_factor.utils import default_device
from zerver.context_processors import get_apps_page_url
from zerver.lib.events import do_events_register
from zerver.lib.events import ClientCapabilities, do_events_register
from zerver.lib.i18n import (
get_and_set_request_language,
get_language_list,
@@ -147,15 +147,16 @@ def build_page_params_for_home_page_load(
The page_params data structure gets sent to the client.
"""
client_capabilities = {
"notification_settings_null": True,
"bulk_message_deletion": True,
"user_avatar_url_field_optional": True,
"stream_typing_notifications": True,
"user_settings_object": True,
"linkifier_url_template": True,
"user_list_incomplete": True,
}
client_capabilities = ClientCapabilities(
notification_settings_null=True,
bulk_message_deletion=True,
user_avatar_url_field_optional=True,
stream_typing_notifications=True,
user_settings_object=True,
linkifier_url_template=True,
user_list_incomplete=True,
)
if user_profile is not None:
client = RequestNotes.get_notes(request).client