parent
1c85bd38b3
commit
781e57e776
|
@ -932,16 +932,14 @@ QtObject:
|
|||
if(communitiesSettingsJArr.len == 0):
|
||||
raise newException(RpcException, fmt"`communitiesSettings` array is empty in the response for community id: {communityKey}")
|
||||
|
||||
var chatsJArr: JsonNode
|
||||
if(not response.result.getProp("chats", chatsJArr)):
|
||||
raise newException(RpcException, fmt"there is no `chats` key in the response for community id: {communityKey}")
|
||||
|
||||
var communityDto = communityJArr[0].toCommunityDto()
|
||||
let communitySettingsDto = communitiesSettingsJArr[0].toCommunitySettingsDto()
|
||||
|
||||
communityDto.settings = communitySettingsDto
|
||||
self.joinedCommunities[communityDto.id] = communityDto
|
||||
|
||||
var chatsJArr: JsonNode
|
||||
if(response.result.getProp("chats", chatsJArr)):
|
||||
for chatObj in chatsJArr:
|
||||
let chatDto = chatObj.toChatDto(communityDto.id)
|
||||
self.chatService.updateOrAddChat(chatDto) # we have to update chats stored in the chat service.
|
||||
|
|
Loading…
Reference in New Issue