2023-02-23 10:25:00 -05:00
|
|
|
# frozen_string_literal: true
|
2023-03-14 15:03:50 -04:00
|
|
|
|
|
|
|
module DiscourseAi
|
2023-02-23 10:25:00 -05:00
|
|
|
module Sentiment
|
|
|
|
class EntryPoint
|
2023-02-23 13:50:10 -05: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 10:25:00 -05:00
|
|
|
|
2023-02-23 13:50:10 -05:00
|
|
|
plugin.on(:post_created, &sentiment_analysis_cb)
|
|
|
|
plugin.on(:post_edited, &sentiment_analysis_cb)
|
2023-11-08 08:50:37 -05:00
|
|
|
|
2024-11-14 10:45:40 -05:00
|
|
|
EmotionFilterOrder.register!(plugin)
|
2024-11-19 08:01:10 -05:00
|
|
|
EmotionDashboardReport.register!(plugin)
|
|
|
|
SentimentDashboardReport.register!(plugin)
|
2023-02-23 10:25:00 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|