mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 00:08:53 +08:00
FEATURE: Merge tagging plugin into core
This commit is contained in:
@ -147,6 +147,7 @@ class PostCreator
|
||||
track_latest_on_category
|
||||
enqueue_jobs
|
||||
BadgeGranter.queue_badge_grant(Badge::Trigger::PostRevision, post: @post)
|
||||
auto_notify_for_tags
|
||||
|
||||
trigger_after_events(@post)
|
||||
|
||||
@ -437,6 +438,15 @@ class PostCreator
|
||||
PostJobsEnqueuer.new(@post, @topic, new_topic?, {import_mode: @opts[:import_mode]}).enqueue_jobs
|
||||
end
|
||||
|
||||
def auto_notify_for_tags
|
||||
tags = DiscourseTagging.tags_for_saving(@opts[:tags], @guardian)
|
||||
if tags.present?
|
||||
@topic.custom_fields.update(DiscourseTagging::TAGS_FIELD_NAME => tags)
|
||||
@topic.save
|
||||
DiscourseTagging.auto_notify_for(tags, @topic)
|
||||
end
|
||||
end
|
||||
|
||||
def new_topic?
|
||||
@opts[:topic_id].blank?
|
||||
end
|
||||
|
Reference in New Issue
Block a user