FIX: correctly shows as disabled a user who can't chat (#26010)

Prior to this fix we were checking if user was not part of a group which allows to chat, but we were not checking if this user was part of groups who can use direct messages.
This commit is contained in:
Joffrey JAFFEUX
2024-03-05 09:13:42 +01:00
committed by GitHub
parent 00e76efb7c
commit 27407a25b4
7 changed files with 49 additions and 9 deletions

View File

@ -5,7 +5,7 @@ module Chat
attributes :can_chat, :has_chat_enabled
def can_chat
SiteSetting.chat_enabled && scope.can_chat?
SiteSetting.chat_enabled && object.guardian.can_chat? && object.guardian.can_direct_message?
end
def has_chat_enabled