diff --git a/templates/zerver/api/changelog.md b/templates/zerver/api/changelog.md index fd3a989d61..6012310000 100644 --- a/templates/zerver/api/changelog.md +++ b/templates/zerver/api/changelog.md @@ -10,6 +10,16 @@ below features are supported. ## Changes in Zulip 2.2 +**Feature level 4** + +* `jitsi_server_url`, `development_environment`, `server_generation`, + `password_min_length`, `password_min_guesses`, `max_file_upload_size_mib`, + `max_avatar_file_size_mib`, `server_inline_image_preview`, + `server_inline_url_embed_preview`, `server_avatar_changes_disabled` and + `server_name_changes_disabled` fields are now available via + `POST /register` to make them accessible to all the clients; + they were only internally available to Zulip's web app prior to this. + **Feature level 3**: * `zulip_version` and `zulip_feature_level` are always returned diff --git a/version.py b/version.py index 206525fb05..0afc106be0 100644 --- a/version.py +++ b/version.py @@ -29,7 +29,7 @@ DESKTOP_WARNING_VERSION = "5.2.0" # # Changes should be accompanied by documentation explaining what the # new level means in templates/zerver/api/changelog.md. -API_FEATURE_LEVEL = 3 +API_FEATURE_LEVEL = 4 # Bump the minor PROVISION_VERSION to indicate that folks should provision # only when going from an old version of the code to a newer version. Bump diff --git a/zerver/lib/events.py b/zerver/lib/events.py index 1a4c067094..beeea1ab18 100644 --- a/zerver/lib/events.py +++ b/zerver/lib/events.py @@ -170,6 +170,17 @@ def fetch_initial_state_data(user_profile: UserProfile, state['zulip_plan_is_not_limited'] = realm.plan_type != Realm.LIMITED state['upgrade_text_for_wide_organization_logo'] = str(Realm.UPGRADE_TEXT_STANDARD) state['realm_default_external_accounts'] = DEFAULT_EXTERNAL_ACCOUNTS + state['jitsi_server_url'] = settings.JITSI_SERVER_URL + state['development_environment'] = settings.DEVELOPMENT + state['server_generation'] = settings.SERVER_GENERATION + state['password_min_length'] = settings.PASSWORD_MIN_LENGTH + state['password_min_guesses'] = settings.PASSWORD_MIN_GUESSES + state['max_file_upload_size_mib'] = settings.MAX_FILE_UPLOAD_SIZE + state['max_avatar_file_size_mib'] = settings.MAX_AVATAR_FILE_SIZE + state['server_inline_image_preview'] = settings.INLINE_IMAGE_PREVIEW + state['server_inline_url_embed_preview'] = settings.INLINE_URL_EMBED_PREVIEW + state['server_avatar_changes_disabled'] = settings.AVATAR_CHANGES_DISABLED + state['server_name_changes_disabled'] = settings.NAME_CHANGES_DISABLED if realm.notifications_stream and not realm.notifications_stream.deactivated: notifications_stream = realm.notifications_stream diff --git a/zerver/views/home.py b/zerver/views/home.py index 40d26eeb32..e10d6f6228 100644 --- a/zerver/views/home.py +++ b/zerver/views/home.py @@ -246,26 +246,15 @@ def home_real(request: HttpRequest) -> HttpResponse: # These end up in a global JavaScript Object named 'page_params'. page_params = dict( # Server settings. - development_environment = settings.DEVELOPMENT, debug_mode = settings.DEBUG, test_suite = settings.TEST_SUITE, poll_timeout = settings.POLL_TIMEOUT, insecure_desktop_app = insecure_desktop_app, login_page = settings.HOME_NOT_LOGGED_IN, root_domain_uri = settings.ROOT_DOMAIN_URI, - max_file_upload_size_mib = settings.MAX_FILE_UPLOAD_SIZE, - max_avatar_file_size_mib = settings.MAX_AVATAR_FILE_SIZE, - server_generation = settings.SERVER_GENERATION, save_stacktraces = settings.SAVE_FRONTEND_STACKTRACES, warn_no_email = settings.WARN_NO_EMAIL, - server_inline_image_preview = settings.INLINE_IMAGE_PREVIEW, - server_inline_url_embed_preview = settings.INLINE_URL_EMBED_PREVIEW, - password_min_length = settings.PASSWORD_MIN_LENGTH, - password_min_guesses = settings.PASSWORD_MIN_GUESSES, - jitsi_server_url = settings.JITSI_SERVER_URL, search_pills_enabled = settings.SEARCH_PILLS_ENABLED, - server_avatar_changes_disabled = settings.AVATAR_CHANGES_DISABLED, - server_name_changes_disabled = settings.NAME_CHANGES_DISABLED, # Misc. extra data. have_initial_messages = user_has_messages,