mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 17:53:44 +08:00
Pass the current_user
to the topic saved event
This commit is contained in:
parent
74051a2df4
commit
0bc0bd7a21
|
@ -85,7 +85,7 @@ class PostsController < ApplicationController
|
|||
[false, MultiJson.dump(errors: post_creator.errors.full_messages)]
|
||||
|
||||
else
|
||||
DiscourseEvent.trigger(:topic_saved, post.topic, params)
|
||||
DiscourseEvent.trigger(:topic_saved, post.topic, params, current_user)
|
||||
post_serializer = PostSerializer.new(post, scope: guardian, root: false)
|
||||
post_serializer.draft_sequence = DraftSequence.current(current_user, post.topic.draft_key)
|
||||
[true, MultiJson.dump(post_serializer)]
|
||||
|
|
|
@ -135,7 +135,7 @@ class TopicsController < ApplicationController
|
|||
success = PostRevisor.new(first_post, topic).revise!(current_user, changes, validate_post: false)
|
||||
end
|
||||
|
||||
DiscourseEvent.trigger(:topic_saved, topic, params)
|
||||
DiscourseEvent.trigger(:topic_saved, topic, params, current_user)
|
||||
|
||||
# this is used to return the title to the client as it may have been changed by "TextCleaner"
|
||||
success ? render_serialized(topic, BasicTopicSerializer) : render_json_error(topic)
|
||||
|
|
Loading…
Reference in New Issue
Block a user