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:
parent
7310ee3ef1
commit
476d0050ab
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue