UX: Show message and chat buttons on hidden profiles (#27326)

This commit is contained in:
Jan Cernik
2024-06-10 10:38:22 -03:00
committed by GitHub
parent b6c2430bf6
commit 1a42249bd8
4 changed files with 63 additions and 8 deletions

View File

@@ -1,12 +1,16 @@
# frozen_string_literal: true
class HiddenProfileSerializer < BasicUserSerializer
attributes(:profile_hidden?, :title, :primary_group_name)
attributes(:profile_hidden?, :title, :primary_group_name, :can_send_private_message_to_user)
def profile_hidden?
true
end
def can_send_private_message_to_user
scope.can_send_private_message?(object)
end
def primary_group_name
object.primary_group.try(:name)
end