fix(Community): Fix community channel admin flag

Fixes: #10382
This commit is contained in:
Boris Melnik 2023-05-12 16:11:44 +03:00
parent 086e05cec3
commit 348024c17e
1 changed files with 3 additions and 0 deletions

View File

@ -583,6 +583,9 @@ method addNewChat*(
chatImage = chatDto.icon chatImage = chatDto.icon
var amIChatAdmin = self.amIMarkedAsAdminUser(chatDto.members) var amIChatAdmin = self.amIMarkedAsAdminUser(chatDto.members)
if not amIChatAdmin and len(chatDto.communityId) != 0:
let community = communityService.getCommunityById(chatDto.communityId)
amIChatAdmin = amIChatAdmin or community.admin
if chatDto.chatType != ChatType.PrivateGroupChat: if chatDto.chatType != ChatType.PrivateGroupChat:
amIChatAdmin = amIChatAdmin or channelGroup.admin amIChatAdmin = amIChatAdmin or channelGroup.admin