fix(chat_section): make chat hidden if category collapsed when creating
Fixes #10381
This commit is contained in:
parent
464110a2db
commit
863c4f5d7a
|
@ -184,9 +184,9 @@ proc init*(self: Controller) =
|
||||||
self.events.on(SIGNAL_COMMUNITY_CHANNEL_CREATED) do(e:Args):
|
self.events.on(SIGNAL_COMMUNITY_CHANNEL_CREATED) do(e:Args):
|
||||||
let args = CommunityChatArgs(e)
|
let args = CommunityChatArgs(e)
|
||||||
let belongsToCommunity = args.chat.communityId.len > 0
|
let belongsToCommunity = args.chat.communityId.len > 0
|
||||||
discard self.delegate.addOrUpdateChat(args.chat, belongsToCommunity, self.events, self.settingsService, self.nodeConfigurationService,
|
discard self.delegate.addOrUpdateChat(args.chat, belongsToCommunity, self.events, self.settingsService,
|
||||||
self.contactService, self.chatService, self.communityService, self.messageService, self.gifService,
|
self.nodeConfigurationService, self.contactService, self.chatService, self.communityService,
|
||||||
self.mailserversService, setChatAsActive = true)
|
self.messageService, self.gifService, self.mailserversService, setChatAsActive = true)
|
||||||
|
|
||||||
self.events.on(SIGNAL_COMMUNITY_CHANNEL_DELETED) do(e:Args):
|
self.events.on(SIGNAL_COMMUNITY_CHANNEL_DELETED) do(e:Args):
|
||||||
let args = CommunityChatIdArgs(e)
|
let args = CommunityChatIdArgs(e)
|
||||||
|
|
|
@ -589,7 +589,10 @@ method addNewChat*(
|
||||||
if chatDto.chatType != ChatType.PrivateGroupChat:
|
if chatDto.chatType != ChatType.PrivateGroupChat:
|
||||||
amIChatAdmin = amIChatAdmin or channelGroup.admin
|
amIChatAdmin = amIChatAdmin or channelGroup.admin
|
||||||
|
|
||||||
|
var categoryOpened = true
|
||||||
if chatDto.categoryId != "":
|
if chatDto.categoryId != "":
|
||||||
|
let categoryItem = self.view.chatsModel.getItemById(chatDto.categoryId)
|
||||||
|
categoryOpened = categoryItem.categoryOpened
|
||||||
if channelGroup.id != "":
|
if channelGroup.id != "":
|
||||||
for category in channelGroup.categories:
|
for category in channelGroup.categories:
|
||||||
if category.id == chatDto.categoryId:
|
if category.id == chatDto.categoryId:
|
||||||
|
@ -623,8 +626,9 @@ method addNewChat*(
|
||||||
colorId,
|
colorId,
|
||||||
colorHash,
|
colorHash,
|
||||||
chatDto.highlight,
|
chatDto.highlight,
|
||||||
|
categoryOpened,
|
||||||
onlineStatus = onlineStatus,
|
onlineStatus = onlineStatus,
|
||||||
loaderActive = setChatAsActive
|
loaderActive = setChatAsActive,
|
||||||
)
|
)
|
||||||
self.addSubmodule(
|
self.addSubmodule(
|
||||||
chatDto.id,
|
chatDto.id,
|
||||||
|
|
|
@ -1061,8 +1061,7 @@ QtObject:
|
||||||
color: string,
|
color: string,
|
||||||
categoryId: string) =
|
categoryId: string) =
|
||||||
try:
|
try:
|
||||||
let response = status_go.createCommunityChannel(communityId, name, description, emoji, color,
|
let response = status_go.createCommunityChannel(communityId, name, description, emoji, color, categoryId)
|
||||||
categoryId)
|
|
||||||
|
|
||||||
if not response.error.isNil:
|
if not response.error.isNil:
|
||||||
let error = Json.decode($response.error, RpcError)
|
let error = Json.decode($response.error, RpcError)
|
||||||
|
|
Loading…
Reference in New Issue