permissions: replace leftover debug changes; fix another copy/paste

This commit is contained in:
John Gibbon 2020-11-16 22:31:37 +01:00
parent c4947260f7
commit c76d079e03
2 changed files with 6 additions and 4 deletions

View file

@ -1208,7 +1208,7 @@ Page {
leftMargin: visible ? Theme.paddingSmall : 0 leftMargin: visible ? Theme.paddingSmall : 0
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
visible: chatPage.chatInformation.can_be_forwarded && selectedMessages.every(function(message){ visible: selectedMessages.every(function(message){
return message.can_be_forwarded return message.can_be_forwarded
}) })
width: visible ? Theme.itemSizeMedium : 0 width: visible ? Theme.itemSizeMedium : 0
@ -1218,6 +1218,7 @@ Page {
var neededPermissions = Functions.getMessagesNeededForwardPermissions(chatPage.selectedMessages); var neededPermissions = Functions.getMessagesNeededForwardPermissions(chatPage.selectedMessages);
var chatId = chatInformation.id; var chatId = chatInformation.id;
pageStack.push(Qt.resolvedUrl("../pages/ChatSelectionPage.qml"), { pageStack.push(Qt.resolvedUrl("../pages/ChatSelectionPage.qml"), {
myUserId: chatPage.myUserId,
headerDescription: qsTr("Forward %n messages", "dialog header", ids.length).arg(ids.length), headerDescription: qsTr("Forward %n messages", "dialog header", ids.length).arg(ids.length),
payload: {fromChatId: chatId, messageIds:ids, neededPermissions: neededPermissions}, payload: {fromChatId: chatId, messageIds:ids, neededPermissions: neededPermissions},
state: "forwardMessages" state: "forwardMessages"

View file

@ -29,6 +29,7 @@ Dialog {
canAccept: false canAccept: false
acceptDestinationAction: PageStackAction.Replace acceptDestinationAction: PageStackAction.Replace
acceptDestinationReplaceTarget: pageStack.find( function(page){ return(page._depth === 0)} ) acceptDestinationReplaceTarget: pageStack.find( function(page){ return(page._depth === 0)} )
property int myUserId: tdLibWrapper.getUserInformation().id;
property alias headerTitle: pageHeader.title property alias headerTitle: pageHeader.title
property alias headerDescription: pageHeader.description property alias headerDescription: pageHeader.description
/* /*
@ -66,7 +67,7 @@ Dialog {
model: chatListModel model: chatListModel
delegate: ChatListViewItem { delegate: ChatListViewItem {
ownUserId: overviewPage.ownUserId ownUserId: chatSelectionPage.myUserId
Loader { // checking permissions takes a while, so we defer those calculations Loader { // checking permissions takes a while, so we defer those calculations
id: visibleLoader id: visibleLoader
asynchronous: true asynchronous: true
@ -105,13 +106,13 @@ Dialog {
} }
property bool valid: visibleLoader && visibleLoader.item && visibleLoader.item.visible property bool valid: visibleLoader && visibleLoader.item && visibleLoader.item.visible
opacity: valid ? 1.0 : 0.5 opacity: valid ? 1.0 : 0
Behavior on opacity { FadeAnimation {}} Behavior on opacity { FadeAnimation {}}
Behavior on height { NumberAnimation {}} Behavior on height { NumberAnimation {}}
// normal height while calculating, otherwise all elements get displayed at once // normal height while calculating, otherwise all elements get displayed at once
height: !visibleLoader.item || visible ? contentHeight : 0 height: !visibleLoader.item || valid ? contentHeight : 0
enabled: valid enabled: valid
onClicked: { onClicked: {
var chat = tdLibWrapper.getChat(display.id); var chat = tdLibWrapper.getChat(display.id);