Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
FIX: Do not send notification to empty push_url
Completes e4424d7
  • Loading branch information
pmusaraj committed Oct 16, 2019
1 parent d6118c8 commit 48c1238
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/services/post_alerter.rb
Expand Up @@ -453,7 +453,7 @@ def push_notification(user, payload)
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))")
.where("push_url IS NOT NULL")
.where("push_url IS NOT NULL AND push_url <> ''")
.where("position(push_url IN ?) > 0", SiteSetting.allowed_user_api_push_urls)
.where("revoked_at IS NULL")
.pluck(:client_id, :push_url)
Expand Down

0 comments on commit 48c1238

Please sign in to comment.