mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 03:21:12 +08:00
FIX: ensures we don't attempt to create a new PM on an existing topic (#9029)
This fix attempts to both fix it at UI level and server side. A previous attempt related to this behavior has been made in commit: 49c750ca78
This commit is contained in:
@ -176,12 +176,12 @@ module DiscourseNarrativeBot
|
||||
if @post &&
|
||||
@post.topic.private_message? &&
|
||||
@post.topic.topic_allowed_users.pluck(:user_id).include?(@user.id)
|
||||
|
||||
opts = opts.merge(topic_id: @post.topic_id)
|
||||
end
|
||||
|
||||
if @data[:topic_id]
|
||||
opts = opts.merge(topic_id: @data[:topic_id])
|
||||
opts = opts
|
||||
.merge(topic_id: @data[:topic_id])
|
||||
.except(:title, :target_usernames, :archetype)
|
||||
end
|
||||
post = reply_to(@post, raw, opts)
|
||||
|
||||
|
@ -208,7 +208,9 @@ module DiscourseNarrativeBot
|
||||
end
|
||||
|
||||
if @data[:topic_id]
|
||||
opts = opts.merge(topic_id: @data[:topic_id])
|
||||
opts = opts
|
||||
.merge(topic_id: @data[:topic_id])
|
||||
.except(:title, :target_usernames, :archetype)
|
||||
end
|
||||
|
||||
post = reply_to(@post, raw, opts)
|
||||
|
Reference in New Issue
Block a user