diff --git a/src/app/modules/main/app_search/module.nim b/src/app/modules/main/app_search/module.nim index bb2b00ffd2..80f941c058 100644 --- a/src/app/modules/main/app_search/module.nim +++ b/src/app/modules/main/app_search/module.nim @@ -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 = @[] diff --git a/src/app_service/service/chat/dto/chat.nim b/src/app_service/service/chat/dto/chat.nim index df6b1a25b7..5aaca0473a 100644 --- a/src/app_service/service/chat/dto/chat.nim +++ b/src/app_service/service/chat/dto/chat.nim @@ -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