mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
FIX: Avoid highlight mention to groups that are not public.
Follow-up to 3f5048118802116679ef28c32728f697cbfb8404.
This commit is contained in:
@ -46,7 +46,7 @@ function updateFound($mentions, usernames) {
|
|||||||
const username = usernames[i];
|
const username = usernames[i];
|
||||||
if (found[username.toLowerCase()]) {
|
if (found[username.toLowerCase()]) {
|
||||||
replaceSpan($e, username, { cannot_see: cannotSee[username] });
|
replaceSpan($e, username, { cannot_see: cannotSee[username] });
|
||||||
} else if (foundGroups[username]) {
|
} else if (mentionableGroups[username]) {
|
||||||
replaceSpan($e, username, {
|
replaceSpan($e, username, {
|
||||||
group: true,
|
group: true,
|
||||||
mentionable: mentionableGroups[username]
|
mentionable: mentionableGroups[username]
|
||||||
|
@ -308,7 +308,7 @@ class UsersController < ApplicationController
|
|||||||
groups = Group.where(name: usernames).pluck(:name)
|
groups = Group.where(name: usernames).pluck(:name)
|
||||||
mentionable_groups =
|
mentionable_groups =
|
||||||
if current_user
|
if current_user
|
||||||
Group.mentionable
|
Group.mentionable(current_user)
|
||||||
.where(name: usernames)
|
.where(name: usernames)
|
||||||
.pluck(:name, :user_count)
|
.pluck(:name, :user_count)
|
||||||
.map do |name, user_count|
|
.map do |name, user_count|
|
||||||
|
Reference in New Issue
Block a user