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
This commit is contained in:
Pascal Precht 2021-06-15 16:07:24 +02:00 committed by Pascal Precht
parent 2427fa2dee
commit cb07813444
1 changed files with 9 additions and 0 deletions

View File

@ -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
}
}
}
}