mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	push notifs: Add a diagnostic in API of whether push notifs enabled.
When the answer is False, this will allow the mobile app to show a warning that push notifications will not work and the server admin should set them up. Based partly on Kunal's PR #7810. Provides the necessary backend API for zulip/zulip-mobile#1507.
This commit is contained in:
		@@ -25,6 +25,7 @@ from zerver.context_processors import zulip_default_context, get_realm_from_requ
 | 
			
		||||
from zerver.forms import HomepageForm, OurAuthenticationForm, \
 | 
			
		||||
    WRONG_SUBDOMAIN_ERROR, ZulipPasswordResetForm
 | 
			
		||||
from zerver.lib.mobile_auth_otp import is_valid_otp, otp_encrypt_api_key
 | 
			
		||||
from zerver.lib.push_notifications import push_notifications_enabled
 | 
			
		||||
from zerver.lib.request import REQ, has_request_variables, JsonableError
 | 
			
		||||
from zerver.lib.response import json_success, json_error
 | 
			
		||||
from zerver.lib.subdomains import get_subdomain, is_subdomain_root_or_alias
 | 
			
		||||
@@ -713,6 +714,7 @@ def api_get_server_settings(request: HttpRequest) -> HttpResponse:
 | 
			
		||||
    result = dict(
 | 
			
		||||
        authentication_methods=get_auth_backends_data(request),
 | 
			
		||||
        zulip_version=ZULIP_VERSION,
 | 
			
		||||
        push_notifications_enabled=push_notifications_enabled(),
 | 
			
		||||
    )
 | 
			
		||||
    context = zulip_default_context(request)
 | 
			
		||||
    # IMPORTANT NOTE:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user