Files

24 lines
618 B
Ruby
Raw Permalink Normal View History

# frozen_string_literal: true
module DiscourseAi
module Sentiment
class EntryPoint
2023-02-23 15:50:10 -03:00
def inject_into(plugin)
sentiment_analysis_cb =
Proc.new do |post|
if SiteSetting.ai_sentiment_enabled
Jobs.enqueue(:post_sentiment_analysis, post_id: post.id)
end
end
2023-02-23 15:50:10 -03:00
plugin.on(:post_created, &sentiment_analysis_cb)
plugin.on(:post_edited, &sentiment_analysis_cb)
2024-11-14 12:45:40 -03:00
EmotionFilterOrder.register!(plugin)
EmotionDashboardReport.register!(plugin)
SentimentDashboardReport.register!(plugin)
end
end
end
end