diff --git a/src/app/modules/main/app_search/module.nim b/src/app/modules/main/app_search/module.nim index c97f6cd645..2016085e70 100644 --- a/src/app/modules/main/app_search/module.nim +++ b/src/app/modules/main/app_search/module.nim @@ -71,7 +71,7 @@ proc getChatSubItems(self: Module, chats: seq[ChatDto], categories: seq[Category var categoryChats: OrderedTable[int, seq[ChatDto]] = initOrderedTable[int, seq[ChatDto]]() for chatDto in chats: - if chatDto.isHiddenChat: + if not chatDto.canView and not chatDto.missingEncryptionKey: continue var chatName = chatDto.name diff --git a/src/app_service/service/chat/dto/chat.nim b/src/app_service/service/chat/dto/chat.nim index 0b988ebce2..5f6152cfe2 100644 --- a/src/app_service/service/chat/dto/chat.nim +++ b/src/app_service/service/chat/dto/chat.nim @@ -254,10 +254,6 @@ proc toChatDto*(jsonObj: JsonNode): ChatDto = discard jsonObj.getProp("readMessagesAtClockValue", result.readMessagesAtClockValue) discard jsonObj.getProp("unviewedMessagesCount", result.unviewedMessagesCount) discard jsonObj.getProp("unviewedMentionsCount", result.unviewedMentionsCount) - discard jsonObj.getProp("canPostReactions", result.canPostReactions) - discard jsonObj.getProp("canPost", result.canPost) - discard jsonObj.getProp("canView", result.canView) - discard jsonObj.getProp("viewersCanPostReactions", result.viewersCanPostReactions) discard jsonObj.getProp("alias", result.alias) discard jsonObj.getProp("muted", result.muted) discard jsonObj.getProp("categoryId", result.categoryId) @@ -286,6 +282,17 @@ proc toChatDto*(jsonObj: JsonNode): ChatDto = (chatTypeInt >= ord(low(ChatType)) or chatTypeInt <= ord(high(ChatType)))): result.chatType = ChatType(chatTypeInt) + # Default those properties to true as they are only provided for community chats + # To be refactored with https://github.com/status-im/status-desktop/issues/11694 + result.canPostReactions = true + result.canPost = true + result.canView = true + result.viewersCanPostReactions = true + discard jsonObj.getProp("canPostReactions", result.canPostReactions) + discard jsonObj.getProp("canPost", result.canPost) + discard jsonObj.getProp("canView", result.canView) + discard jsonObj.getProp("viewersCanPostReactions", result.viewersCanPostReactions) + var chatImage: string discard jsonObj.getProp("image", chatImage) if (result.chatType == ChatType.PrivateGroupChat and len(chatImage) > 0):