Don't require WebNotifications permission

This commit is contained in:
Ivanq 2019-04-26 12:55:33 +03:00
parent 9ddb984004
commit 6e58e8d50f

View file

@ -243,11 +243,6 @@ class Wrapper
actionWebNotification: (message) -> actionWebNotification: (message) ->
$.when(@event_site_info).done => $.when(@event_site_info).done =>
# Check that this site may send notifications
if "WebNotifications" not in @site_info.settings.permissions
res = {"error": "No WebNotifications permission"}
@sendInner {"cmd": "response", "to": message.id, "result": res}
return
# Check that the wrapper may send notifications # Check that the wrapper may send notifications
if Notification.permission == "granted" if Notification.permission == "granted"
@displayWebNotification message @displayWebNotification message
@ -261,11 +256,6 @@ class Wrapper
actionCloseWebNotification: (message) -> actionCloseWebNotification: (message) ->
$.when(@event_site_info).done => $.when(@event_site_info).done =>
# Check that this site may send notifications
if "WebNotifications" not in @site_info.settings.permissions
res = {"error": "No WebNotifications permission"}
@sendInner {"cmd": "response", "to": message.id, "result": res}
return
id = message.params[0] id = message.params[0]
@web_notifications[id].close() @web_notifications[id].close()