From 987d5b9fcefd49ad1ebf926f3516448478c39bb9 Mon Sep 17 00:00:00 2001 From: Mark VanLandingham Date: Fri, 16 Jun 2023 14:48:07 -0500 Subject: [PATCH] DEV: Add plugin modifier to expand group mentions in post_alerter (#22163) --- app/services/post_alerter.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/services/post_alerter.rb b/app/services/post_alerter.rb index 4e533e09a05..fbda2e7cb64 100644 --- a/app/services/post_alerter.rb +++ b/app/services/post_alerter.rb @@ -151,8 +151,15 @@ class PostAlerter expand_group_mentions(mentioned_groups, post) do |group, users| users = only_allowed_users(users, post) + to_notify = + DiscoursePluginRegistry.apply_modifier( + :expand_group_mention_users, + users - notified, + group, + ) + notified += - notify_users(users - notified, :group_mentioned, post, mentioned_opts.merge(group: group)) + notify_users(to_notify, :group_mentioned, post, mentioned_opts.merge(group: group)) end if mentioned_here