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