2024-09-06 13:11:47 +00:00
|
|
|
import QtQuick 2.15
|
2022-02-08 12:08:02 +00:00
|
|
|
|
|
|
|
QtObject {
|
|
|
|
id: root
|
|
|
|
|
2024-10-30 19:02:46 +00:00
|
|
|
property var chatCommunitySectionModule
|
|
|
|
property var chatDetails
|
2022-02-08 12:08:02 +00:00
|
|
|
property var usersModule
|
|
|
|
|
2024-10-30 19:02:46 +00:00
|
|
|
readonly property var usersModel: {
|
|
|
|
if (!chatDetails && !chatCommunitySectionModule) {
|
|
|
|
return null
|
|
|
|
}
|
|
|
|
let isFullCommunityList = !chatDetails.requiresPermissions
|
|
|
|
if (chatDetails.belongsToCommunity && isFullCommunityList && !!chatCommunitySectionModule) {
|
|
|
|
// Community channel with no permisisons. We can use the section's membersModel
|
|
|
|
return chatCommunitySectionModule.membersModel
|
|
|
|
}
|
|
|
|
return usersModule ? usersModule.model : null
|
|
|
|
}
|
2022-11-08 08:36:08 +00:00
|
|
|
readonly property var temporaryModel: usersModule ? usersModule.temporaryModel : null
|
|
|
|
|
|
|
|
function appendTemporaryModel(pubKey, displayName) {
|
|
|
|
usersModule.appendTemporaryModel(pubKey, displayName)
|
|
|
|
}
|
|
|
|
function removeFromTemporaryModel(pubKey) {
|
|
|
|
usersModule.removeFromTemporaryModel(pubKey)
|
|
|
|
}
|
|
|
|
function resetTemporaryModel() {
|
|
|
|
usersModule.resetTemporaryModel()
|
|
|
|
}
|
|
|
|
function updateGroupMembers() {
|
|
|
|
usersModule.updateGroupMembers()
|
2022-02-08 12:08:02 +00:00
|
|
|
}
|
|
|
|
}
|