mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 09:42:46 +08:00
DEV: Apply syntax_tree formatting to plugins/*
This commit is contained in:
@ -9,16 +9,17 @@ class Chat::Api::HintsController < ApplicationController
|
||||
|
||||
raise Discourse::InvalidParameters.new(:mentions) if group_names.blank?
|
||||
|
||||
visible_groups = Group
|
||||
.where("LOWER(name) IN (?)", group_names)
|
||||
.visible_groups(current_user)
|
||||
.pluck(:name)
|
||||
visible_groups =
|
||||
Group.where("LOWER(name) IN (?)", group_names).visible_groups(current_user).pluck(:name)
|
||||
|
||||
mentionable_groups = filter_mentionable_groups(visible_groups)
|
||||
|
||||
result = {
|
||||
unreachable: visible_groups - mentionable_groups.map(&:name),
|
||||
over_members_limit: mentionable_groups.select { |g| g.user_count > SiteSetting.max_users_notified_per_group_mention }.map(&:name),
|
||||
over_members_limit:
|
||||
mentionable_groups
|
||||
.select { |g| g.user_count > SiteSetting.max_users_notified_per_group_mention }
|
||||
.map(&:name),
|
||||
}
|
||||
|
||||
result[:invalid] = (group_names - result[:unreachable]) - result[:over_members_limit]
|
||||
|
Reference in New Issue
Block a user