discourse/app/jobs/regular/post_update_topic_tracking_state.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
495 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module Jobs
class PostUpdateTopicTrackingState < ::Jobs::Base
def execute(args)
post = Post.find_by(id: args[:post_id])
if post && post.topic
TopicTrackingState.publish_unmuted(post.topic)
if post.post_number > 1
TopicTrackingState.publish_muted(post.topic)
TopicTrackingState.publish_unread(post)
end
TopicTrackingState.publish_latest(post.topic, post.whisper?)
end
end
end
end