2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-07 12:02:53 +08:00

FIX: Disable notices for posts by anonymous.

This commit is contained in:
Dan Ungureanu 2019-03-13 00:18:58 +02:00
parent 7310ee3ef1
commit 476d0050ab
No known key found for this signature in database
GPG key ID: 0AA2A00D6ACC8B84

View file

@ -370,7 +370,9 @@ class PostSerializer < BasicPostSerializer
end
def include_post_notice_type?
return false if scope.user&.id == object.user_id || !scope.user&.has_trust_level?(SiteSetting.min_post_notice_tl)
return false if !scope.user || !scope.user.id || scope.user.id == object.user_id ||
!object.user || object.user.anonymous? ||
!scope.user.has_trust_level?(SiteSetting.min_post_notice_tl)
post_notice_type.present?
end