fix(chat_section): make chat hidden if category collapsed when creating

Fixes #10381
This commit is contained in:
Jonathan Rainville 2023-05-17 14:27:58 -04:00 committed by Iuri Matias
parent 464110a2db
commit 863c4f5d7a
3 changed files with 9 additions and 6 deletions

View File

@ -184,9 +184,9 @@ proc init*(self: Controller) =
self.events.on(SIGNAL_COMMUNITY_CHANNEL_CREATED) do(e:Args):
let args = CommunityChatArgs(e)
let belongsToCommunity = args.chat.communityId.len > 0
discard self.delegate.addOrUpdateChat(args.chat, belongsToCommunity, self.events, self.settingsService, self.nodeConfigurationService,
self.contactService, self.chatService, self.communityService, self.messageService, self.gifService,
self.mailserversService, setChatAsActive = true)
discard self.delegate.addOrUpdateChat(args.chat, belongsToCommunity, self.events, self.settingsService,
self.nodeConfigurationService, self.contactService, self.chatService, self.communityService,
self.messageService, self.gifService, self.mailserversService, setChatAsActive = true)
self.events.on(SIGNAL_COMMUNITY_CHANNEL_DELETED) do(e:Args):
let args = CommunityChatIdArgs(e)

View File

@ -589,7 +589,10 @@ method addNewChat*(
if chatDto.chatType != ChatType.PrivateGroupChat:
amIChatAdmin = amIChatAdmin or channelGroup.admin
var categoryOpened = true
if chatDto.categoryId != "":
let categoryItem = self.view.chatsModel.getItemById(chatDto.categoryId)
categoryOpened = categoryItem.categoryOpened
if channelGroup.id != "":
for category in channelGroup.categories:
if category.id == chatDto.categoryId:
@ -623,8 +626,9 @@ method addNewChat*(
colorId,
colorHash,
chatDto.highlight,
categoryOpened,
onlineStatus = onlineStatus,
loaderActive = setChatAsActive
loaderActive = setChatAsActive,
)
self.addSubmodule(
chatDto.id,

View File

@ -1061,8 +1061,7 @@ QtObject:
color: string,
categoryId: string) =
try:
let response = status_go.createCommunityChannel(communityId, name, description, emoji, color,
categoryId)
let response = status_go.createCommunityChannel(communityId, name, description, emoji, color, categoryId)
if not response.error.isNil:
let error = Json.decode($response.error, RpcError)