harbour-fernschreiber/qml/pages/ChatInformationPage.qml

83 lines
2.9 KiB
QML
Raw Permalink Normal View History

/*
Copyright (C) 2020 Sebastian J. Wolf and other contributors
This file is part of Fernschreiber.
Fernschreiber is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Fernschreiber is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Fernschreiber. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.6
import Sailfish.Silica 1.0
import "../components"
import "../components/chatInformationPage"
import "../js/twemoji.js" as Emoji
import "../js/functions.js" as Functions
2020-11-20 23:58:26 +03:00
import "../js/debug.js" as Debug
Page {
id: chatInformationPage
allowedOrientations: Orientation.All
property string searchString
property int chatOnlineMemberCount: 0;
property int myUserId: tdLibWrapper.getUserInformation().id;
property bool isPrivateChat: false
2020-11-28 21:11:51 +03:00
property bool isSecretChat: false
property bool isBasicGroup: false
property bool isSuperGroup: false
property bool isChannel: false
property string chatPartnerGroupId
2020-11-28 21:11:51 +03:00
property bool userIsMember: ((isPrivateChat || isSecretChat ) && chatInformation["@type"]) || // should be optimized
(isBasicGroup || isSuperGroup) && (
(groupInformation.status["@type"] === "chatMemberStatusMember")
|| (groupInformation.status["@type"] === "chatMemberStatusAdministrator")
|| (groupInformation.status["@type"] === "chatMemberStatusRestricted" && groupInformation.status.is_member)
|| (groupInformation.status["@type"] === "chatMemberStatusCreator" && groupInformation.status.is_member)
)
property var chatInformation:({});
property var privateChatUserInformation:({});
property var chatPartnerFullInformation:({});
property var chatPartnerProfilePhotos:([]);
property var groupInformation: ({});
property var groupFullInformation: ({});
// property alias membersList: membersList
onStatusChanged: {
switch(status) {
case PageStatus.Activating:
2020-11-20 23:58:26 +03:00
Debug.log("activating Loader")
mainContentLoader.active = true
break;
case PageStatus.Active:
break;
}
}
Loader {
id: mainContentLoader
active: false
asynchronous: true
anchors.fill: parent
source: Qt.resolvedUrl("../components/chatInformationPage/ChatInformationPageContent.qml");
}
}