From c7843919a713712b8a559b8a2a328dc81ec8b140 Mon Sep 17 00:00:00 2001 From: John Gibbon Date: Mon, 26 Oct 2020 10:24:50 +0100 Subject: [PATCH] hide poll IconButton if not applicable --- qml/pages/ChatPage.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qml/pages/ChatPage.qml b/qml/pages/ChatPage.qml index 56c39da..83d519e 100644 --- a/qml/pages/ChatPage.qml +++ b/qml/pages/ChatPage.qml @@ -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});