mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
improve receiver specs to account for posts approval
This commit is contained in:
parent
9bba68ed74
commit
e4980392da
5 changed files with 40 additions and 5 deletions
|
@ -375,7 +375,8 @@ module Email
|
|||
options[:raw] << "</details>" << "\n"
|
||||
end
|
||||
|
||||
manager = NewPostManager.new(options[:user], options)
|
||||
user = options.delete(:user)
|
||||
manager = NewPostManager.new(user, options)
|
||||
result = manager.perform
|
||||
|
||||
raise InvalidPost, result.errors.full_messages.join("\n") if result.errors.any?
|
||||
|
@ -383,7 +384,7 @@ module Email
|
|||
if result.post
|
||||
@incoming_email.update_columns(topic_id: result.post.topic_id, post_id: result.post.id)
|
||||
if result.post.topic && result.post.topic.private_message?
|
||||
add_other_addresses(result.post.topic, options[:user])
|
||||
add_other_addresses(result.post.topic, user)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue