mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
REFACTOR: Use Topic#private_message? to reduce duplication.
This commit is contained in:
@@ -176,7 +176,7 @@ module DiscourseNarrativeBot
|
||||
}
|
||||
|
||||
if @post &&
|
||||
@post.archetype == Archetype.private_message &&
|
||||
@post.topic.private_message? &&
|
||||
@post.topic.topic_allowed_users.pluck(:user_id).include?(@user.id)
|
||||
|
||||
opts = opts.merge(topic_id: @post.topic_id)
|
||||
|
||||
@@ -190,7 +190,7 @@ module DiscourseNarrativeBot
|
||||
}
|
||||
|
||||
if @post &&
|
||||
@post.archetype == Archetype.private_message &&
|
||||
@post.topic.private_message? &&
|
||||
@post.topic.topic_allowed_users.pluck(:user_id).include?(@user.id)
|
||||
|
||||
opts = opts.merge(topic_id: @post.topic_id)
|
||||
|
||||
Reference in New Issue
Block a user