hide poll IconButton if not applicable

This commit is contained in:
John Gibbon 2020-10-26 10:24:50 +01:00
parent c4d67de8a5
commit c7843919a7

View file

@ -1181,7 +1181,10 @@ Page {
}
}
IconButton {
visible: !chatPage.isPrivateChat
visible: !chatPage.isPrivateChat &&
(chatGroupInformation.status["@type"] === "chatMemberStatusCreator"
|| chatGroupInformation.status["@type"] === "chatMemberStatusAdministrator"
|| (chatGroupInformation.status["@type"] === "chatMemberStatusMember" && chatInformation.permissions.can_send_polls))
icon.source: "image://theme/icon-m-question"
onClicked: {
pageStack.push(Qt.resolvedUrl("../pages/PollCreationPage.qml"), { "chatId" : chatInformation.id, groupName: chatInformation.title});