mirror of
https://github.com/discourse/discourse.git
synced 2026-09-05 04:40:41 -05:00
FIX: ensure 'notifications_state' is up to date after creating a notification
This commit is contained in:
@@ -425,8 +425,10 @@ class PostAlerter
|
||||
|
||||
if SiteSetting.allow_user_api_key_scopes.split("|").include?("push") && SiteSetting.allowed_user_api_push_urls.present?
|
||||
clients = user.user_api_keys
|
||||
.where("('push' = ANY(scopes) OR 'notifications' = ANY(scopes)) AND push_url IS NOT NULL AND position(push_url in ?) > 0 AND revoked_at IS NULL",
|
||||
SiteSetting.allowed_user_api_push_urls)
|
||||
.where("('push' = ANY(scopes) OR 'notifications' = ANY(scopes))")
|
||||
.where("push_url IS NOT NULL")
|
||||
.where("position(push_url IN ?) > 0", SiteSetting.allowed_user_api_push_urls)
|
||||
.where("revoked_at IS NULL")
|
||||
.pluck(:client_id, :push_url)
|
||||
|
||||
if clients.length > 0
|
||||
|
||||
Reference in New Issue
Block a user