mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 09:08:10 +08:00
improve receiver specs to account for posts approval
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user