mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 18:41:09 +08:00
FEATURE: Notify user when mention can't see the reply they were mentioned in
FIX: Group Mention Notifications
This commit is contained in:
@ -242,11 +242,18 @@ class UsersController < ApplicationController
|
||||
usernames -= groups
|
||||
usernames.each(&:downcase!)
|
||||
|
||||
cannot_see = []
|
||||
topic_id = params[:topic_id]
|
||||
unless topic_id.blank?
|
||||
topic = Topic.find_by(id: topic_id)
|
||||
usernames.each{ |username| cannot_see.push(username) unless Guardian.new(User.find_by_username(username)).can_see?(topic) }
|
||||
end
|
||||
|
||||
result = User.where(staged: false)
|
||||
.where(username_lower: usernames)
|
||||
.pluck(:username_lower)
|
||||
|
||||
render json: {valid: result, valid_groups: groups, mentionable_groups: mentionable_groups}
|
||||
render json: {valid: result, valid_groups: groups, mentionable_groups: mentionable_groups, cannot_see: cannot_see}
|
||||
end
|
||||
|
||||
def render_available_true
|
||||
|
Reference in New Issue
Block a user