fix: duplicated channels when joining a community

Fixes #5729
This commit is contained in:
Richard Ramos 2022-05-16 11:55:02 -04:00 committed by Iuri Matias
parent 851228544b
commit e944263b57
1 changed files with 2 additions and 0 deletions

View File

@ -256,6 +256,8 @@ proc toChatDto*(jsonObj: JsonNode, communityId: string): ChatDto =
result = jsonObj.toChatDto() result = jsonObj.toChatDto()
result.chatType = ChatType.CommunityChat result.chatType = ChatType.CommunityChat
result.communityId = communityId result.communityId = communityId
if communityId != "":
result.id = communityId & result.id.replace(communityId, "") # Adding communityID prefix in case it's not available
proc isPublicChat*(chatDto: ChatDto): bool = proc isPublicChat*(chatDto: ChatDto): bool =
return chatDto.chatType == ChatType.Public return chatDto.chatType == ChatType.Public