From 8081da7fa0612efcc9d72d374de7c3b0dd4371ab Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Tue, 15 Jun 2021 16:07:24 +0200 Subject: [PATCH] feat(StatusChatList): introduce `filterFn` and `categoryId` Chat lists can belong to a category inside of communities, so they should hold a property `categoryId` that represents that. In addition, this commit introduces a `filterFn` function that can be used to conditionally show/hide chat list items. Closes #154 --- ui/StatusQ/src/StatusQ/Components/StatusChatList.qml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ui/StatusQ/src/StatusQ/Components/StatusChatList.qml b/ui/StatusQ/src/StatusQ/Components/StatusChatList.qml index f96acc868d..07e7e2fdba 100644 --- a/ui/StatusQ/src/StatusQ/Components/StatusChatList.qml +++ b/ui/StatusQ/src/StatusQ/Components/StatusChatList.qml @@ -10,9 +10,12 @@ Column { spacing: 4 + property string categoryId: "" property string selectedChatId: "" property alias chatListItems: statusChatListItems + property var filterFn + signal chatItemSelected(string id) signal chatItemUnmuted(string id) @@ -33,6 +36,12 @@ Column { onClicked: statusChatList.chatItemSelected(model.chatId) onUnmute: statusChatList.chatItemUnmuted(model.chatId) + visible: { + if (!!statusChatList.filterFn) { + return statusChatList.filterFn(model, statusChatList.categoryId) + } + return true + } } } }