mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Live update edits
This commit is contained in:
@@ -137,12 +137,6 @@ class PostCreator
|
||||
end
|
||||
end
|
||||
|
||||
def secure_group_ids(topic)
|
||||
@secure_group_ids ||= if topic.category && topic.category.read_restricted?
|
||||
topic.category.secure_group_ids
|
||||
end
|
||||
end
|
||||
|
||||
def clear_possible_flags(topic)
|
||||
# at this point we know the topic is a PM and has been replied to ... check if we need to clear any flags
|
||||
#
|
||||
@@ -255,7 +249,7 @@ class PostCreator
|
||||
user: BasicUserSerializer.new(@post.user).as_json(root: false),
|
||||
post_number: @post.post_number
|
||||
},
|
||||
group_ids: secure_group_ids(@topic)
|
||||
group_ids: @topic.secure_group_ids
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
@@ -19,12 +19,30 @@ class PostRevisor
|
||||
update_topic_word_counts
|
||||
@post.advance_draft_sequence
|
||||
PostAlerter.new.after_save_post(@post)
|
||||
publish_revision
|
||||
|
||||
true
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def publish_revision
|
||||
MessageBus.publish("/topic/#{@post.topic_id}",{
|
||||
id: @post.id,
|
||||
post_number: @post.post_number,
|
||||
updated_at: @post.updated_at,
|
||||
type: "revised"
|
||||
},
|
||||
group_ids: @post.topic.secure_group_ids
|
||||
)
|
||||
end
|
||||
|
||||
def secure_group_ids(topic)
|
||||
@secure_group_ids ||= if topic.category && topic.category.read_restricted?
|
||||
topic.category.secure_group_ids
|
||||
end
|
||||
end
|
||||
|
||||
def should_revise?
|
||||
@post.raw != @new_raw
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user