2020-11-16 23:38:55 +03:00
|
|
|
/*
|
|
|
|
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/>.
|
|
|
|
*/
|
2020-10-19 13:20:02 +03:00
|
|
|
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
|
2020-10-19 13:20:02 +03:00
|
|
|
|
|
|
|
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
|
2020-10-19 13:20:02 +03:00
|
|
|
property bool isBasicGroup: false
|
|
|
|
property bool isSuperGroup: false
|
|
|
|
property bool isChannel: false
|
2021-01-14 02:33:46 +03:00
|
|
|
readonly property bool canGetMembers: ("can_get_members" in groupFullInformation) && groupFullInformation.can_get_members
|
2020-10-19 13:20:02 +03:00
|
|
|
|
|
|
|
property string chatPartnerGroupId
|
|
|
|
|
2020-11-28 21:11:51 +03:00
|
|
|
property bool userIsMember: ((isPrivateChat || isSecretChat ) && chatInformation["@type"]) || // should be optimized
|
2020-10-19 13:20:02 +03:00
|
|
|
(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)
|
|
|
|
)
|
|
|
|
|
2020-11-06 01:23:37 +03:00
|
|
|
property var chatInformation:({});
|
|
|
|
property var privateChatUserInformation:({});
|
|
|
|
property var chatPartnerFullInformation:({});
|
|
|
|
property var chatPartnerProfilePhotos:([]);
|
|
|
|
property var groupInformation: ({});
|
|
|
|
property var groupFullInformation: ({});
|
2020-10-19 13:20:02 +03:00
|
|
|
|
2020-11-16 23:38:55 +03:00
|
|
|
// property alias membersList: membersList
|
2020-10-19 13:20:02 +03:00
|
|
|
|
2020-11-16 23:38:55 +03:00
|
|
|
onStatusChanged: {
|
|
|
|
switch(status) {
|
|
|
|
case PageStatus.Activating:
|
2020-11-20 23:58:26 +03:00
|
|
|
Debug.log("activating Loader")
|
2020-11-16 23:38:55 +03:00
|
|
|
mainContentLoader.active = true
|
2020-10-19 13:20:02 +03:00
|
|
|
break;
|
2020-11-16 23:38:55 +03:00
|
|
|
case PageStatus.Active:
|
2020-10-19 13:20:02 +03:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-16 23:38:55 +03:00
|
|
|
Loader {
|
|
|
|
id: mainContentLoader
|
|
|
|
active: false
|
|
|
|
asynchronous: true
|
2020-10-19 13:20:02 +03:00
|
|
|
anchors.fill: parent
|
2020-11-16 23:38:55 +03:00
|
|
|
source: Qt.resolvedUrl("../components/chatInformationPage/ChatInformationPageContent.qml");
|
2020-10-19 13:20:02 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|