fix(search): fix searching for hidden chats

Fixes #14961
This commit is contained in:
Jonathan Rainville 2024-06-04 14:28:50 -04:00
parent 9d5c5c64cc
commit 146a6e8501
2 changed files with 9 additions and 0 deletions

View File

@ -68,6 +68,9 @@ method getModuleAsVariant*(self: Module): QVariant =
proc getChatSubItems(self: Module, chats: seq[ChatDto]): seq[location_menu_sub_item.SubItem] =
for chatDto in chats:
if chatDto.isHiddenChat:
continue
var chatName = chatDto.name
var chatImage = chatDto.icon
var colorHash: ColorHashDto = @[]
@ -168,6 +171,9 @@ proc getResultItemFromChats(self: Module, sectionId: string, chats: seq[ChatDto]
let searchTerm = self.controller.searchTerm().toLower
for chatDto in chats:
if chatDto.isHiddenChat:
continue
var chatName = chatDto.name
var chatImage = chatDto.icon
var colorHash: ColorHashDto = @[]

View File

@ -350,3 +350,6 @@ proc isPrivateGroupChat*(c: ChatDto): bool =
proc isActivePersonalChat*(c: ChatDto): bool =
return c.active and (c.isOneToOne() or c.isPrivateGroupChat()) and c.communityId == ""
proc isHiddenChat*(chatDto: ChatDto): bool =
return chatDto.hideIfPermissionsNotMet and not chatDto.canView