diff --git a/lib/topic_assigner.rb b/lib/topic_assigner.rb new file mode 100644 index 0000000..7cf283c --- /dev/null +++ b/lib/topic_assigner.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +class ::TopicAssigner + def self.backfill_auto_assign + deprecation_note + Assigner.backfill_auto_assign + end + + def self.assigned_self?(text) + deprecation_note + Assigner.assigned_self?(text) + end + + def self.auto_assign(post, force: false) + deprecation_note + Assigner.auto_assign(post, force) + end + + def self.is_last_staff_post?(post) + deprecation_note + Assigner.is_last_staff_post?(post) + end + + def self.mentioned_staff(post) + deprecation_note + Assigner.mentioned_staff(post) + end + + def self.publish_topic_tracking_state(topic, user_id) + deprecation_note + Assigner.publish_topic_tracking_state(topic, user_id) + end + + def initialize(target, user) + self.class.deprecation_note + Assigner.new(target, user) + end + + def self.deprecation_note + Discourse.deprecate("TopicAssigner class is deprecated, use Assigner", since: "2.8", drop_from: "2.9") + end +end diff --git a/plugin.rb b/plugin.rb index e3c4f53..536cdb3 100644 --- a/plugin.rb +++ b/plugin.rb @@ -33,6 +33,7 @@ after_initialize do require File.expand_path('../jobs/regular/remind_user.rb', __FILE__) require File.expand_path('../jobs/regular/assign_notification.rb', __FILE__) require File.expand_path('../jobs/regular/unassign_notification.rb', __FILE__) + require 'topic_assigner' require 'assigner' require 'pending_assigns_reminder'