feat(@desktop/group-chat): adjust members permissions

closes: #7154
closes: #7155
This commit is contained in:
Patryk Osmaczko 2022-08-29 16:33:14 +02:00 committed by osmaczko
parent 1ca7a92600
commit 2d5c69bc6c
3 changed files with 9 additions and 17 deletions

View File

@ -81,7 +81,8 @@ RowLayout {
d.groupUsersModel.insert(d.groupUsersModel.count,
{"pubKey": entry.pubKey,
"name": entry.name,
"icon": entry.icon})
"icon": entry.icon,
"isReadonly": !root.chatContentModule.amIChatAdmin()})
}
}
@ -93,7 +94,8 @@ RowLayout {
"displayName": entry2.name,
"icon": entry2.icon,
"isIdenticon": false,
"onlineStatus": false})
"onlineStatus": false,
"isReadonly": !root.chatContentModule.amIChatAdmin()})
}
// Update contacts list used by StatusTagSelector

View File

@ -65,15 +65,13 @@ StatusModal {
return qsTr("1 member");
}
}
header.editable: !addMembers && popup.isAdmin
header.editable: !addMembers
header.asset.isLetterIdenticon: (popup.chatDetails.icon === "")
header.asset.name: (popup.chatDetails.icon !== "") ? popup.chatDetails.icon : popup.chatDetails.name
header.asset.isImage: (popup.chatDetails.icon !== "")
header.asset.bgColor: popup.chatDetails ? popup.chatDetails.color : "transparent"
onEditButtonClicked: {
renameGroupPopup.open()
}
onEditButtonClicked: renameGroupPopup.open()
onClosed: {
chatSectionModule.clearMyContacts()
@ -229,13 +227,6 @@ StatusModal {
}
StatusPopupMenu {
id: contextMenu
StatusMenuItem {
icon.name: "admin"
icon.width: 16
icon.height: 16
text: qsTr("Make Admin")
onTriggered: popup.chatSectionModule.makeAdmin("", popup.chatDetails.id, model.pubKey)
}
StatusMenuItem {
icon.name: "remove-contact"
icon.width: 16
@ -266,7 +257,7 @@ StatusModal {
rightButtons: [
StatusButton {
visible: !popup.addMembers && popup.isAdmin
visible: !popup.addMembers
text: qsTr("Add members")
onClicked: {
popup.addMembers = true;

View File

@ -62,9 +62,9 @@ StatusPopupMenu {
}
StatusMenuItem {
text: qsTr("Add / remove from group")
text: root.amIChatAdmin ? qsTr("Add / remove from group") : qsTr("Add to group")
icon.name: "add-to-dm"
enabled: root.amIChatAdmin && (root.chatType === Constants.chatType.privateGroupChat)
enabled: (root.chatType === Constants.chatType.privateGroupChat)
onTriggered: { root.addRemoveGroupMember() }
}
@ -88,7 +88,6 @@ StatusPopupMenu {
text: qsTr("Edit name and image")
icon.name: "edit_pencil"
enabled: root.chatType === Constants.chatType.privateGroupChat
&& root.amIChatAdmin
onTriggered: {
Global.openPopup(renameGroupPopupComponent, {
activeGroupName: root.chatName,