mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-08 04:34:01 +00:00
fix(search): only show channels in the locations if they can be viewed
Partly fixed #10184
This commit is contained in:
parent
9d06f82840
commit
e4895c0dad
@ -71,7 +71,7 @@ proc getChatSubItems(self: Module, chats: seq[ChatDto], categories: seq[Category
|
|||||||
var categoryChats: OrderedTable[int, seq[ChatDto]] = initOrderedTable[int, seq[ChatDto]]()
|
var categoryChats: OrderedTable[int, seq[ChatDto]] = initOrderedTable[int, seq[ChatDto]]()
|
||||||
|
|
||||||
for chatDto in chats:
|
for chatDto in chats:
|
||||||
if chatDto.isHiddenChat:
|
if not chatDto.canView and not chatDto.missingEncryptionKey:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
var chatName = chatDto.name
|
var chatName = chatDto.name
|
||||||
|
@ -254,10 +254,6 @@ proc toChatDto*(jsonObj: JsonNode): ChatDto =
|
|||||||
discard jsonObj.getProp("readMessagesAtClockValue", result.readMessagesAtClockValue)
|
discard jsonObj.getProp("readMessagesAtClockValue", result.readMessagesAtClockValue)
|
||||||
discard jsonObj.getProp("unviewedMessagesCount", result.unviewedMessagesCount)
|
discard jsonObj.getProp("unviewedMessagesCount", result.unviewedMessagesCount)
|
||||||
discard jsonObj.getProp("unviewedMentionsCount", result.unviewedMentionsCount)
|
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("alias", result.alias)
|
||||||
discard jsonObj.getProp("muted", result.muted)
|
discard jsonObj.getProp("muted", result.muted)
|
||||||
discard jsonObj.getProp("categoryId", result.categoryId)
|
discard jsonObj.getProp("categoryId", result.categoryId)
|
||||||
@ -286,6 +282,17 @@ proc toChatDto*(jsonObj: JsonNode): ChatDto =
|
|||||||
(chatTypeInt >= ord(low(ChatType)) or chatTypeInt <= ord(high(ChatType)))):
|
(chatTypeInt >= ord(low(ChatType)) or chatTypeInt <= ord(high(ChatType)))):
|
||||||
result.chatType = ChatType(chatTypeInt)
|
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
|
var chatImage: string
|
||||||
discard jsonObj.getProp("image", chatImage)
|
discard jsonObj.getProp("image", chatImage)
|
||||||
if (result.chatType == ChatType.PrivateGroupChat and len(chatImage) > 0):
|
if (result.chatType == ChatType.PrivateGroupChat and len(chatImage) > 0):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user