mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-20 10:38:47 +00:00
fix channel missing a name when re-joining
This commit is contained in:
parent
5ec9fe4ebd
commit
e3a5c6bad3
@ -155,9 +155,10 @@ QtObject:
|
|||||||
proc getChatsOfChatTypes*(self: Service, types: seq[chat_dto.ChatType]): seq[ChatDto] =
|
proc getChatsOfChatTypes*(self: Service, types: seq[chat_dto.ChatType]): seq[ChatDto] =
|
||||||
return self.getAllChats().filterIt(it.chatType in types)
|
return self.getAllChats().filterIt(it.chatType in types)
|
||||||
|
|
||||||
proc getChatById*(self: Service, chatId: string): ChatDto =
|
proc getChatById*(self: Service, chatId: string, showWarning: bool = true): ChatDto =
|
||||||
if(not self.chats.contains(chatId)):
|
if(not self.chats.contains(chatId)):
|
||||||
error "trying to get chat data for an unexisting chat id", chatId
|
if (showWarning):
|
||||||
|
warn "trying to get chat data for an unexisting chat id", chatId
|
||||||
return
|
return
|
||||||
|
|
||||||
return self.chats[chatId]
|
return self.chats[chatId]
|
||||||
|
@ -312,6 +312,18 @@ QtObject:
|
|||||||
var community = self.allCommunities[communityId]
|
var community = self.allCommunities[communityId]
|
||||||
self.joinedCommunities[communityId] = community
|
self.joinedCommunities[communityId] = community
|
||||||
|
|
||||||
|
for k, chat in community.chats:
|
||||||
|
let fullChatId = communityId & chat.id
|
||||||
|
let currentChat = self.chatService.getChatById(fullChatId, showWarning = false)
|
||||||
|
echo currentChat
|
||||||
|
if (currentChat.id != ""):
|
||||||
|
# The chat service already knows that about that chat
|
||||||
|
continue
|
||||||
|
var chatDto = mapChatToChatDto(chat, communityId)
|
||||||
|
chatDto.id = fullChatId
|
||||||
|
# TODO find a way to populate missing infos like the color
|
||||||
|
self.chatService.updateOrAddChat(chatDto)
|
||||||
|
|
||||||
self.events.emit(SIGNAL_COMMUNITY_JOINED, CommunityArgs(community: community))
|
self.events.emit(SIGNAL_COMMUNITY_JOINED, CommunityArgs(community: community))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
error "Error joining the community", msg = e.msg
|
error "Error joining the community", msg = e.msg
|
||||||
|
Loading…
x
Reference in New Issue
Block a user