FIX: Don't run event hooks when plugin is disabled (#45)

FIX: Don’t run event hooks when plugin is disabled (#45)

plugin-api’s on prevents the hook from being called when the plugin is disabled

diff --git a/plugin.rb b/plugin.rb
index e767416..fe44abb 100644
--- a/plugin.rb
+++ b/plugin.rb
@@ -318,7 +318,7 @@ after_initialize do
-  DiscourseEvent.on(:user_added_to_group) do |user, group|
+  on(:user_added_to_group) do |user, group|
     next if !SiteSetting.approve_past_posts_on_becoming_category_expert
     category_ids = group.category_expert_category_ids
@@ -327,7 +327,7 @@ after_initialize do
     ::Jobs.enqueue(:approve_past_category_expert_posts, user_id:, category_ids: category_ids)
-  DiscourseEvent.on(:user_removed_from_group) do |user, group|
+  on(:user_removed_from_group) do |user, group|
     category_ids = group.category_expert_category_ids
     next if category_ids.empty?

GitHub sha: ef1472255ce79f0aff4270fad735b961d4bedc7c

This commit appears in #45 which was approved by romanrizzi, ZogStriP, and eviltrout. It was merged by CvX.