mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 03:51:07 +08:00
REFACTOR: Use Topic#private_message?
to reduce duplication.
This commit is contained in:
@ -58,7 +58,7 @@ after_initialize do
|
||||
|
||||
topic = type == 'post' ? Post.find_by(id: id).topic : Topic.find_by(id: id)
|
||||
|
||||
if topic.archetype == Archetype.private_message
|
||||
if topic.private_message?
|
||||
user_ids = User.where('admin OR moderator').pluck(:id) + topic.allowed_users.pluck(:id)
|
||||
group_ids = topic.allowed_groups.pluck(:id)
|
||||
|
||||
|
Reference in New Issue
Block a user