diff --git a/harbour-fernschreiber.pro b/harbour-fernschreiber.pro
index bcd8333..f72d480 100644
--- a/harbour-fernschreiber.pro
+++ b/harbour-fernschreiber.pro
@@ -51,6 +51,7 @@ DISTFILES += qml/harbour-fernschreiber.qml \
qml/components/PhotoTextsListItem.qml \
qml/components/WebPagePreview.qml \
qml/components/chatInformationPage/ChatInformationEditArea.qml \
+ qml/components/chatInformationPage/ChatInformationPageContent.qml \
qml/components/chatInformationPage/ChatInformationProfilePicture.qml \
qml/components/chatInformationPage/ChatInformationProfilePictureList.qml \
qml/components/chatInformationPage/ChatInformationTabItemBase.qml \
diff --git a/qml/components/chatInformationPage/ChatInformationPageContent.qml b/qml/components/chatInformationPage/ChatInformationPageContent.qml
new file mode 100644
index 0000000..4b78df8
--- /dev/null
+++ b/qml/components/chatInformationPage/ChatInformationPageContent.qml
@@ -0,0 +1,457 @@
+/*
+ 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 .
+*/
+import QtQuick 2.6
+import Sailfish.Silica 1.0
+import "../"
+import "../../js/twemoji.js" as Emoji
+import "../../js/functions.js" as Functions
+
+
+SilicaFlickable {
+ id: pageContent
+ property alias membersList: membersList
+
+ function initializePage() {
+ membersList.clear();
+ var chatType = chatInformation.type["@type"];
+ switch(chatType) {
+ case "chatTypePrivate":
+ chatInformationPage.isPrivateChat = true;
+ chatInformationPage.chatPartnerGroupId = chatInformationPage.chatInformation.type.user_id.toString();
+ if(!chatInformationPage.privateChatUserInformation.id) {
+ chatInformationPage.privateChatUserInformation = tdLibWrapper.getUserInformation(chatInformationPage.chatPartnerGroupId);
+ }
+ tdLibWrapper.getUserFullInfo(chatInformationPage.chatPartnerGroupId);
+ tdLibWrapper.getUserProfilePhotos(chatInformationPage.chatPartnerGroupId, 100, 0);
+ break;
+ case "chatTypeBasicGroup":
+ chatInformationPage.isBasicGroup = true;
+ chatInformationPage.chatPartnerGroupId = chatInformation.type.basic_group_id.toString();
+ if(!chatInformationPage.groupInformation.id) {
+ chatInformationPage.groupInformation = tdLibWrapper.getBasicGroup(chatInformationPage.chatPartnerGroupId);
+ }
+ tdLibWrapper.getGroupFullInfo(chatInformationPage.chatPartnerGroupId, false);
+ break;
+ case "chatTypeSupergroup":
+ chatInformationPage.isSuperGroup = true;
+ chatInformationPage.chatPartnerGroupId = chatInformation.type.supergroup_id.toString();
+ if(!chatInformationPage.groupInformation.id) {
+ chatInformationPage.groupInformation = tdLibWrapper.getSuperGroup(chatInformationPage.chatPartnerGroupId);
+ }
+
+ tdLibWrapper.getGroupFullInfo(chatInformationPage.chatPartnerGroupId, true);
+ chatInformationPage.isChannel = chatInformationPage.groupInformation.is_channel;
+ break;
+ }
+ console.log("is set up", chatInformationPage.isPrivateChat, chatInformationPage.isBasicGroup, chatInformationPage.isSuperGroup, chatInformationPage.chatPartnerGroupId)
+ if(!chatInformationPage.isPrivateChat) {
+ updateGroupStatusText();
+ }
+
+
+ tabViewLoader.active = true;
+ }
+ function scrollUp(force) {
+ if(force) {
+ // animation does not always work while quick scrolling
+ scrollUpTimer.start()
+ } else {
+ scrollUpAnimation.start()
+ }
+ }
+ function scrollDown(force) {
+ if(force) {
+ scrollDownTimer.start()
+ } else {
+ scrollDownAnimation.start()
+ }
+ }
+ function handleBasicGroupFullInfo(groupFullInfo) {
+ chatInformationPage.groupFullInformation = groupFullInfo;
+ membersList.clear();
+ if(groupFullInfo.members && groupFullInfo.members.length > 0) {
+ for(var memberIndex in groupFullInfo.members) {
+ var memberData = groupFullInfo.members[memberIndex];
+ var userInfo = tdLibWrapper.getUserInformation(memberData.user_id) || {user:{}, bot_info:{}};
+ memberData.user = userInfo;
+ memberData.bot_info = memberData.bot_info || {};
+ membersList.append(memberData);
+ }
+ chatInformationPage.groupInformation.member_count = groupFullInfo.members.length
+ updateGroupStatusText();
+ }
+ }
+ function updateGroupStatusText() {
+ if (chatOnlineMemberCount > 0) {
+ headerItem.description = qsTr("%1 members, %2 online").arg(Functions.getShortenedCount(chatInformationPage.groupInformation.member_count)).arg(Functions.getShortenedCount(chatInformationPage.chatOnlineMemberCount));
+ } else {
+ if (isChannel) {
+ headerItem.description = qsTr("%1 subscribers").arg(Functions.getShortenedCount(chatInformationPage.groupInformation.member_count));
+ } else {
+ headerItem.description = qsTr("%1 members").arg(Functions.getShortenedCount(chatInformationPage.groupInformation.member_count));
+ }
+ }
+ }
+
+ Connections {
+ target: tdLibWrapper
+
+ onChatOnlineMemberCountUpdated: {
+ if ((chatInformationPage.isSuperGroup || chatInformationPage.isBasicGroup) && chatInformationPage.chatInformation.id.toString() === chatId) {
+ chatInformationPage.chatOnlineMemberCount = onlineMemberCount;
+ updateGroupStatusText();
+ }
+ }
+ onSupergroupFullInfoReceived: {
+ console.log("onSupergroupFullInfoReceived", chatInformationPage.isSuperGroup, chatInformationPage.chatPartnerGroupId, groupId)
+ if(chatInformationPage.isSuperGroup && chatInformationPage.chatPartnerGroupId === groupId) {
+ chatInformationPage.groupFullInformation = groupFullInfo;
+ }
+ }
+ onSupergroupFullInfoUpdated: {
+ console.log("onSupergroupFullInfoUpdated", chatInformationPage.isSuperGroup, chatInformationPage.chatPartnerGroupId, groupId)
+ if(chatInformationPage.isSuperGroup && chatInformationPage.chatPartnerGroupId === groupId) {
+ chatInformationPage.groupFullInformation = groupFullInfo;
+ }
+ }
+ onBasicGroupFullInfoReceived: {
+ if(chatInformationPage.isBasicGroup && chatInformationPage.chatPartnerGroupId === groupId) {
+ handleBasicGroupFullInfo(groupFullInfo)
+ }
+ }
+
+ onBasicGroupFullInfoUpdated: {
+ if(chatInformationPage.isBasicGroup && chatInformationPage.chatPartnerGroupId === groupId) {
+ handleBasicGroupFullInfo(groupFullInfo)
+ }
+ }
+ onUserFullInfoReceived: {
+ if(chatInformationPage.isPrivateChat && userFullInfo["@extra"] === chatInformationPage.chatPartnerGroupId) {
+ chatInformationPage.chatPartnerFullInformation = userFullInfo;
+ }
+ }
+ onUserFullInfoUpdated: {
+ if(chatInformationPage.isPrivateChat && userId === chatInformationPage.chatPartnerGroupId) {
+ chatInformationPage.chatPartnerFullInformation = userFullInfo;
+ }
+ }
+
+ onUserProfilePhotosReceived: {
+ if(chatInformationPage.isPrivateChat && extra === chatInformationPage.chatPartnerGroupId) {
+ chatInformationPage.chatPartnerProfilePhotos = photos;
+ }
+ }
+ onChatPermissionsUpdated: {
+ if (chatInformationPage.chatInformation.id.toString() === chatId) {
+ // set whole object to trigger change
+ var newInformation = chatInformation;
+ newInformation.permissions = permissions
+ chatInformationPage.chatInformation = newInformation
+ }
+ }
+ onChatTitleUpdated: {
+ if (chatInformationPage.chatInformation.id.toString() === chatId) {
+ // set whole object to trigger change
+ var newInformation = chatInformation;
+ newInformation.title = title
+ chatInformationPage.chatInformation = newInformation
+ }
+ }
+ }
+
+
+
+ Component.onCompleted: {7
+ initializePage();
+ }
+
+
+
+ ListModel {
+ id: membersList
+ }
+
+ AppNotification {
+ id: infoNotification
+ }
+ PullDownMenu {
+ MenuItem {
+ visible: (chatInformationPage.isSuperGroup || chatInformationPage.isBasicGroup) && chatInformationPage.groupInformation && chatInformationPage.groupInformation.status["@type"] !== "chatMemberStatusBanned"
+ text: chatInformationPage.userIsMember ? qsTr("Leave Chat") : qsTr("Join Chat")
+ onClicked: {
+ // ensure it's done even if the page is closed:
+ if (chatInformationPage.userIsMember) {
+ var remorse = Remorse.popupAction(appWindow, qsTr("Leaving chat"), (function(chatid) {
+ return function() {
+ tdLibWrapper.leaveChat(chatid);
+ // this does not care about the response (ideally type "ok" without further reference) for now
+ pageStack.pop(pageStack.find( function(page){ return(page._depth === 0)} ));
+ };
+ }(chatInformationPage.chatInformation.id)))
+ } else {
+ tdLibWrapper.joinChat(chatInformationPage.chatInformation.id);
+ }
+
+
+ }
+ }
+ MenuItem {
+ visible: chatInformationPage.userIsMember
+ onClicked: {
+ var newNotificationSettings = chatInformationPage.chatInformation.notification_settings;
+ if (newNotificationSettings.mute_for > 0) {
+ newNotificationSettings.mute_for = 0;
+ } else {
+ newNotificationSettings.mute_for = 6666666;
+ }
+ newNotificationSettings.use_default_mute_for = false;
+ tdLibWrapper.setChatNotificationSettings(chatInformationPage.chatInformation.id, newNotificationSettings);
+ }
+ text: chatInformation.notification_settings.mute_for > 0 ? qsTr("Unmute Chat") : qsTr("Mute Chat")
+ }
+ // MenuItem { //TODO Implement
+ // visible: !userIsMember
+ // onClicked: {
+ // tdLibWrapper.joinChat(chatInformationPage.chatInformation.id);
+ // }
+ // text: qsTr("Join Chat")
+ // }
+ }
+ // header
+ PageHeader {
+ id: headerItem
+ z: 5
+ Item {
+ id: imageContainer
+ property bool hasImage: typeof chatInformationPage.chatInformation.photo !== "undefined"
+ property int minDimension: chatInformationPage.isLandscape ? Theme.itemSizeSmall : Theme.itemSizeMedium
+ property int maxDimension: Screen.width / 2
+ property int minX: Theme.horizontalPageMargin
+ property int maxX: (chatInformationPage.width - maxDimension)/2
+ property int minY: Theme.paddingSmall//(parent.height - minDimension)/2
+ property int maxY: parent.height
+ property double tweenFactor: {
+ if(!hasImage) {
+ return 0
+ }
+ return 1 - Math.max(0, Math.min(1, contentFlickable.contentY / maxDimension))
+ }
+
+ function getEased(min,max,factor) {
+ return min + (max-min)*factor
+ }
+ width: getEased(minDimension,maxDimension, tweenFactor)
+ height: width
+ x: getEased(minX,maxX, tweenFactor)
+ y: getEased(minY,maxY, tweenFactor)
+
+ ProfileThumbnail {
+ id: chatPictureThumbnail
+ photoData: imageContainer.hasImage ? chatInformationPage.chatInformation.photo.small : ""
+ replacementStringHint: headerItem.title
+ width: parent.width
+ height: width
+ radius: imageContainer.minDimension / 2
+ opacity: profilePictureLoader.status !== Loader.Ready || profilePictureLoader.item.opacity < 1 ? 1.0 : 0.0
+ optimizeImageSize: false
+ }
+ Loader {
+ id: profilePictureLoader
+ active: imageContainer.hasImage
+ asynchronous: true
+ anchors.fill: chatPictureThumbnail
+ source: chatInformationPage.isPrivateChat
+ ? "../components/chatInformationPage/ChatInformationProfilePictureList.qml"
+ : "../components/chatInformationPage/ChatInformationProfilePicture.qml"
+ }
+ }
+ // PageHeader changes the html base path:
+ property url emojiBase: "../js/emoji/"
+ leftMargin: imageContainer.getEased((imageContainer.minDimension + Theme.paddingMedium), 0, imageContainer.tweenFactor) + Theme.horizontalPageMargin
+ title: chatInformationPage.chatInformation.title !== "" ? Emoji.emojify(chatInformationPage.chatInformation.title, Theme.fontSizeLarge, emojiBase) : qsTr("Unknown")
+ description: chatInformationPage.isPrivateChat ? ("@"+(chatInformationPage.privateChatUserInformation.username || chatInformationPage.chatPartnerGroupId)) : ""
+ }
+
+ SilicaFlickable {
+ id: contentFlickable
+ contentHeight: groupInfoItem.height + tabViewLoader.height
+ clip: true
+ interactive: !scrollUpAnimation.running && !scrollDownAnimation.running
+
+ anchors {
+ top: headerItem.bottom
+ bottom: parent.bottom
+ left: parent.left
+ right: parent.right
+ }
+ NumberAnimation {
+ id: scrollDownAnimation
+ target: contentFlickable
+ to: groupInfoItem.height
+ property: "contentY"
+ duration: 500
+ easing.type: Easing.InOutCubic
+ }
+ NumberAnimation {
+ id: scrollUpAnimation
+ target: contentFlickable
+ to: 0
+ property: "contentY"
+ duration: 500
+ easing.type: Easing.InOutCubic
+ property Timer scrollUpTimer: Timer {
+ id: scrollUpTimer
+ interval: 50
+ onTriggered: {
+ contentFlickable.scrollToTop()
+ }
+ }
+ property Timer scrollDownTimer: Timer {
+ id: scrollDownTimer
+ interval: 50
+ onTriggered: {
+ contentFlickable.scrollToBottom()
+ }
+ }
+ }
+
+ Column {
+ id: groupInfoItem
+ bottomPadding: Theme.paddingLarge
+ topPadding: Theme.paddingLarge
+ anchors {
+ top: parent.top
+ left: parent.left
+ leftMargin: Theme.horizontalPageMargin
+ right: parent.right
+ rightMargin: Theme.horizontalPageMargin
+ }
+
+ Item { //large image placeholder
+ width: parent.width
+ height: imageContainer.hasImage ? imageContainer.maxDimension : 0
+ }
+
+ ChatInformationEditArea {
+ visible: canEdit
+ canEdit: !chatInformationPage.isPrivateChat && chatInformationPage.groupInformation.status && (chatInformationPage.groupInformation.status.can_change_info || chatInformationPage.groupInformation.status["@type"] === "chatMemberStatusCreator")
+ headerText: qsTr("Chat Title", "group title header")
+ text: chatInformationPage.chatInformation.title
+
+ onSaveButtonClicked: {
+ if(!editItem.errorHighlight) {
+ tdLibWrapper.setChatTitle(chatInformationPage.chatInformation.id, textValue);
+ } else {
+ isEditing = true
+ }
+ }
+
+ onTextEdited: {
+ if(textValue.length > 0 && textValue.length < 129) {
+ editItem.errorHighlight = false
+ editItem.label = ""
+ editItem.placeholderText = ""
+ } else {
+ editItem.label = qsTr("Enter 1-128 characters")
+ editItem.placeholderText = editItem.label
+ editItem.errorHighlight = true
+ }
+ }
+ }
+ ChatInformationEditArea {
+ canEdit: (chatInformationPage.isPrivateChat && chatInformationPage.privateChatUserInformation.id === chatInformationPage.myUserId) || ((chatInformationPage.isBasicGroup || chatInformationPage.isSuperGroup) && chatInformationPage.groupInformation && (chatInformationPage.groupInformation.status.can_change_info || chatInformationPage.groupInformation.status["@type"] === "chatMemberStatusCreator"))
+ emptyPlaceholderText: qsTr("There is no information text available, yet.")
+ headerText: qsTr("Info", "group or user infotext header")
+ multiLine: true
+ text: (chatInformationPage.isPrivateChat ? chatInformationPage.chatPartnerFullInformation.bio : chatInformationPage.groupFullInformation.description) || ""
+ onSaveButtonClicked: {
+ if(chatInformationPage.isPrivateChat) { // own bio
+ tdLibWrapper.setBio(textValue);
+ } else { // group info
+ tdLibWrapper.setChatDescription(chatInformationPage.chatInformation.id, textValue);
+ }
+ }
+ }
+
+ ChatInformationTextItem {
+ headerText: qsTr("Phone Number", "user phone number header")
+ text: (chatInformationPage.isPrivateChat && chatInformationPage.privateChatUserInformation.phone_number ? "+"+chatInformationPage.privateChatUserInformation.phone_number : "") || ""
+ isLinkedLabel: true
+ }
+
+ SectionHeader {
+ font.pixelSize: Theme.fontSizeExtraSmall
+ visible: !!inviteLinkItem.text
+ height: visible ? Theme.itemSizeExtraSmall : 0
+ text: qsTr("Invite Link", "header")
+ x: 0
+ }
+
+ Row {
+ width: parent.width
+ visible: !!inviteLinkItem.text
+ ChatInformationTextItem {
+ id: inviteLinkItem
+ text: !isPrivateChat ? chatInformationPage.groupFullInformation.invite_link : ""
+ width: parent.width - inviteLinkButton.width
+ }
+ IconButton {
+ id: inviteLinkButton
+ icon.source: "image://theme/icon-m-clipboard"
+ anchors.verticalCenter: inviteLinkItem.verticalCenter
+ onClicked: {
+ Clipboard.text = chatInformationPage.groupFullInformation.invite_link
+ infoNotification.show(qsTr("The Invite Link has been copied to the clipboard."));
+ }
+ }
+ }
+
+ Item {
+ width: parent.width
+ height: Theme.paddingLarge
+ }
+
+ Separator {
+ width: parent.width
+ color: Theme.primaryColor
+ horizontalAlignment: Qt.AlignHCenter
+ opacity: (tabViewLoader.status === Loader.Ready && tabViewLoader.item.count > 0) ? 1.0 : 0.0
+
+ Behavior on opacity { FadeAnimation {}}
+ }
+ }
+
+ Loader {
+ id: tabViewLoader
+ asynchronous: true
+ active: false
+ anchors {
+ left: parent.left
+ right: parent.right
+ top: groupInfoItem.bottom
+ }
+ sourceComponent: Component {
+ ChatInformationTabView {
+ id: tabView
+ height: tabView.count > 0 ? chatInformationPage.height - headerItem.height : 0
+ }
+ }
+ }
+ }
+}
diff --git a/qml/components/chatInformationPage/ChatInformationProfilePicture.qml b/qml/components/chatInformationPage/ChatInformationProfilePicture.qml
index 6bdb47d..16753e7 100644
--- a/qml/components/chatInformationPage/ChatInformationProfilePicture.qml
+++ b/qml/components/chatInformationPage/ChatInformationProfilePicture.qml
@@ -25,7 +25,7 @@ Item {
visible: imageContainer.tweenFactor > 0.8 && chatPictureDetail.imageStatus === Image.Ready
property bool isActive: imageContainer.tweenFactor === 1.0
opacity: isActive ? 1.0 : 0.0
- Behavior on opacity { NumberAnimation {} }
+ Behavior on opacity { FadeAnimation {} }
ProfileThumbnail {
id: chatPictureDetail
anchors.fill: parent
diff --git a/qml/components/chatInformationPage/ChatInformationProfilePictureList.qml b/qml/components/chatInformationPage/ChatInformationProfilePictureList.qml
index 8cbc677..f9586be 100644
--- a/qml/components/chatInformationPage/ChatInformationProfilePictureList.qml
+++ b/qml/components/chatInformationPage/ChatInformationProfilePictureList.qml
@@ -25,7 +25,7 @@ Item {
property bool isActive: imageContainer.tweenFactor === 1.0
opacity: isActive ? 1.0 : 0.0
- Behavior on opacity { NumberAnimation {} }
+ Behavior on opacity { FadeAnimation {} }
SlideshowView {
id: bigProfilePictureList
diff --git a/qml/components/chatInformationPage/ChatInformationTabItemBase.qml b/qml/components/chatInformationPage/ChatInformationTabItemBase.qml
index a3472c4..8f152f6 100644
--- a/qml/components/chatInformationPage/ChatInformationTabItemBase.qml
+++ b/qml/components/chatInformationPage/ChatInformationTabItemBase.qml
@@ -30,16 +30,13 @@ Item {
property alias loadingVisible: loadingColumn.loadingVisible
property string loadingText
- property int tabIndex: tabItem.VisualItemModel.index
- property bool active: tabItem.ListView.isCurrentItem
+ property int tabIndex: index
+ property bool active: index === tabView.currentIndex
default property alias _data: contentItem.data
-
- width: parent.width
- height: tabView.maxHeight//Math.max(contentItem.height, loadingColumn.height)
opacity: active ? 1.0 : 0.0
- Behavior on opacity { PropertyAnimation {duration: 300}}
+ Behavior on opacity { FadeAnimation {}}
Column {
id: loadingColumn
@@ -50,7 +47,7 @@ Item {
topPadding: Theme.paddingLarge
anchors.top: parent.top
opacity: loadingVisible ? 1.0 : 0.0
- Behavior on opacity { NumberAnimation {} }
+ Behavior on opacity { FadeAnimation {} }
visible: tabItem.loading
InfoLabel {
diff --git a/qml/components/chatInformationPage/ChatInformationTabItemMembersGroups.qml b/qml/components/chatInformationPage/ChatInformationTabItemMembersGroups.qml
index a1212d1..28bb536 100644
--- a/qml/components/chatInformationPage/ChatInformationTabItemMembersGroups.qml
+++ b/qml/components/chatInformationPage/ChatInformationTabItemMembersGroups.qml
@@ -27,8 +27,6 @@ import "../../js/functions.js" as Functions
ChatInformationTabItemBase {
id: tabBase
- title: chatInformationPage.isPrivateChat ? qsTr("Groups", "Button: groups in common (short)") : qsTr("Members", "Button: Group Members")
- image: "image://theme/icon-m-people"
loadingText: isPrivateChat ? qsTr("Loading common chats…", "chats you have in common with a user") : qsTr("Loading group members…")
loading: ( chatInformationPage.isSuperGroup || chatInformationPage.isPrivateChat) && !chatInformationPage.isChannel
loadingVisible: loading && membersView.count === 0
@@ -37,18 +35,18 @@ ChatInformationTabItemBase {
SilicaListView {
id: membersView
- model: isPrivateChat ? (chatPartnerCommonGroupsIds.length > 0 ? delegateModel : null) : chatInformationPage.membersList
+ model: chatInformationPage.isPrivateChat ? (chatPartnerCommonGroupsIds.length > 0 ? delegateModel : null) : pageContent.membersList
clip: true
height: tabBase.height
width: tabBase.width
opacity: tabBase.loading ? (count > 0 ? 0.5 : 0.0) : 1.0
- Behavior on opacity { NumberAnimation {} }
+ Behavior on opacity { FadeAnimation {} }
function handleScrollIntoView(force){
if(!tabBase.loading && !dragging && !quickScrollAnimating ) {
if(!atYBeginning) {
- chatInformationPage.scrollDown()
+ pageContent.scrollDown()
} else {
- chatInformationPage.scrollUp(force);
+ pageContent.scrollUp(force);
}
}
}
@@ -59,7 +57,7 @@ ChatInformationTabItemBase {
handleScrollIntoView()
}
onAtYEndChanged: {
- if(tabBase.active && !tabBase.loading && chatInformationPage.isSuperGroup && (groupInformation.member_count > membersView.count) && membersView.atYEnd) {
+ if(tabBase.active && !tabBase.loading && chatInformationPage.isSuperGroup && !chatInformationPage.isChannel && (chatInformationPage.groupInformation.member_count > membersView.count) && membersView.atYEnd) {
tabBase.loading = true;
fetchMoreMembersTimer.start()
}
@@ -78,7 +76,7 @@ ChatInformationTabItemBase {
}
width: parent.width
- // chat title isPrivateChat ? () :
+ // chat title
primaryText.text: Emoji.emojify(Functions.getUserName(user), primaryText.font.pixelSize, "../js/emoji/")
// last user
prologSecondaryText.text: "@"+(user.username !== "" ? user.username : user_id) + (user_id === chatInformationPage.myUserId ? " " + qsTr("You") : "")
@@ -100,7 +98,7 @@ ChatInformationTabItemBase {
}
footer: Component {
Item {
- property bool active: tabBase.active && chatInformationPage.isSuperGroup && (groupInformation.member_count > membersView.count)
+ property bool active: tabBase.active && chatInformationPage.isSuperGroup && (chatInformationPage.groupInformation.member_count > membersView.count)
width: tabBase.width
height: active ? Theme.itemSizeLarge : Theme.paddingMedium
@@ -174,9 +172,9 @@ ChatInformationTabItemBase {
interval: 600
property int fetchLimit: 50
onTriggered: {
- if(isSuperGroup && !isChannel) {
+ if(chatInformationPage.isSuperGroup && !chatInformationPage.isChannel && (chatInformationPage.groupInformation.member_count > membersView.count)) { //
tabBase.loading = true
- tdLibWrapper.getSupergroupMembers(chatInformationPage.chatPartnerGroupId, fetchLimit, membersList.count);
+ tdLibWrapper.getSupergroupMembers(chatInformationPage.chatPartnerGroupId, fetchLimit, pageContent.membersList.count);
fetchLimit = 200
interval = 400
}
@@ -187,20 +185,20 @@ ChatInformationTabItemBase {
target: tdLibWrapper
onChatMembersReceived: {
- if (isSuperGroup && chatInformationPage.chatPartnerGroupId === extra) {
- if(members && members.length > 0) {
+ if (chatInformationPage.isSuperGroup && chatInformationPage.chatPartnerGroupId === extra) {
+ if(members && members.length > 0 && chatInformationPage.groupInformation.member_count > membersView.count) {
for(var memberIndex in members) {
var memberData = members[memberIndex];
var userInfo = tdLibWrapper.getUserInformation(memberData.user_id) || {user:{}, bot_info:{}};
memberData.user = userInfo;
memberData.bot_info = memberData.bot_info || {};
- membersList.append(memberData);
+ pageContent.membersList.append(memberData);
}
- groupInformation.member_count = totalMembers
+ chatInformationPage.groupInformation.member_count = totalMembers
updateGroupStatusText();
- if(membersList.count < totalMembers) {
+// if(pageContent.membersList.count < totalMembers) {
// fetchMoreMembersTimer.start()
- }
+// }
}
// if we set it directly, the views start scrolling
loadedTimer.start();
@@ -224,9 +222,9 @@ ChatInformationTabItemBase {
}
Component.onCompleted: {
- if(isPrivateChat) {
+ if(chatInformationPage.isPrivateChat) {
tdLibWrapper.getGroupsInCommon(chatInformationPage.chatPartnerGroupId, 200, 0); // we only use the first 200
- } else if(isSuperGroup) {
+ } else if(chatInformationPage.isSuperGroup) {
fetchMoreMembersTimer.start();
}
}
diff --git a/qml/components/chatInformationPage/ChatInformationTabItemSettings.qml b/qml/components/chatInformationPage/ChatInformationTabItemSettings.qml
index 9b189ba..30315a1 100644
--- a/qml/components/chatInformationPage/ChatInformationTabItemSettings.qml
+++ b/qml/components/chatInformationPage/ChatInformationTabItemSettings.qml
@@ -27,8 +27,8 @@ import "../../js/functions.js" as Functions
ChatInformationTabItemBase {
id: tabBase
- title: qsTr("Settings", "Button: Chat Settings")
- image: "image://theme/icon-m-developer-mode"
+// title: qsTr("Settings", "Button: Chat Settings")
+// image: "image://theme/icon-m-developer-mode"
SilicaFlickable {
height: tabBase.height
diff --git a/qml/components/chatInformationPage/ChatInformationTabView.qml b/qml/components/chatInformationPage/ChatInformationTabView.qml
index e399401..f550821 100644
--- a/qml/components/chatInformationPage/ChatInformationTabView.qml
+++ b/qml/components/chatInformationPage/ChatInformationTabView.qml
@@ -54,22 +54,21 @@ Item {
width: parent.width
columns: tabView.count
Repeater {
- model: tabView.count
+ model: tabModel
delegate: BackgroundItem {
id: headerItem
- property bool loaded: tabItem.image !== "" && tabItem.title !== ""
+ property bool loaded: image !== "" && title !== ""
width: loaded ? (headerGrid.width / tabView.count) : 0
opacity: loaded ? 1.0 : 0.0
- Behavior on width { PropertyAnimation {duration: 300}}
- Behavior on opacity { PropertyAnimation {duration: 300}}
+ Behavior on width { PropertyAnimation {duration: 200}}
+ Behavior on opacity { FadeAnimation {}}
height: Theme.itemSizeLarge
- property ChatInformationTabItemBase tabItem: tabView.model.get(index)
property int itemIndex: index
- property bool itemIsActive: tabItem.active
+ property bool itemIsActive: tabView.currentIndex === itemIndex
Icon {
id: headerIcon
- source: headerItem.tabItem.image
+ source: image
highlighted: headerItem.pressed || headerItem.itemIsActive
anchors {
top: parent.top
@@ -77,7 +76,7 @@ Item {
}
}
Label {
- text: headerItem.tabItem.title
+ text: title
width: parent.width
horizontalAlignment: Text.AlignHCenter
anchors.top: headerIcon.bottom
@@ -85,7 +84,7 @@ Item {
font.pixelSize: Theme.fontSizeTiny
}
onClicked: {
- chatInformationPage.scrollDown()
+ pageContent.scrollDown()
tabView.openTab(itemIndex)
}
}
@@ -105,7 +104,6 @@ Item {
highlightMoveDuration: 500
property int maxHeight: tabViewItem.height - tabViewHeader.height
-
anchors {
top: tabViewHeader.bottom
left: parent.left
@@ -116,51 +114,33 @@ Item {
function openTab(index) {
currentIndex = index;
}
- model: VisualItemModel {
+ model: ListModel {
id: tabModel
}
- }
- Component {
- id: membersGroupComponent
- ChatInformationTabItemMembersGroups{
+ delegate: Loader {
width: tabView.width
+ height: tabView.maxHeight
+ asynchronous: true
+ source: Qt.resolvedUrl(tab+".qml")
}
}
- Component {
- id: settingsComponent
- ChatInformationTabItemSettings {
- width: tabView.width
- }
- }
- Component {
- id: debugComponent
- ChatInformationTabItemDebug {
- width: tabView.width
- }
- }
- property var tabItems: {
- var items = [];
+ Component.onCompleted: {
if(!(isPrivateChat && chatPartnerGroupId === myUserId.toString())) {
- items.push(membersGroupComponent);
+ tabModel.append({
+ tab:"ChatInformationTabItemMembersGroups",
+ title: chatInformationPage.isPrivateChat ? qsTr("Groups", "Button: groups in common (short)") : qsTr("Members", "Button: Group Members"),
+ image: "image://theme/icon-m-people"
+ });
}
if(!isPrivateChat && (groupInformation.status.can_restrict_members || groupInformation.status["@type"] === "chatMemberStatusCreator")) {
- items.push(settingsComponent);
+ tabModel.append({
+ tab:"ChatInformationTabItemSettings",
+ title: qsTr("Settings", "Button: Chat Settings"),
+ image: "image://theme/icon-m-developer-mode"
+ });
}
-// items.push(debugComponent);
+// tabModel.append({tab:"ChatInformationTabItemDebug"});
- return items;
- }
- onTabItemsChanged: fillTabItems()
-
- function fillTabItems() {
- tabModel.clear()
- for(var i in tabItems) {
- tabModel.append(tabItems[i].createObject(tabModel));
- }
- }
-
- Component.onCompleted: {
- fillTabItems()
}
}
diff --git a/qml/pages/ChatInformationPage.qml b/qml/pages/ChatInformationPage.qml
index cd1f060..0a1ff0c 100644
--- a/qml/pages/ChatInformationPage.qml
+++ b/qml/pages/ChatInformationPage.qml
@@ -1,3 +1,21 @@
+/*
+ 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 .
+*/
import QtQuick 2.6
import Sailfish.Silica 1.0
import "../components"
@@ -36,427 +54,27 @@ Page {
property var groupInformation: ({});
property var groupFullInformation: ({});
- property alias membersList: membersList
+// property alias membersList: membersList
- function initializePage() {
- console.log("[ChatInformationPage] Initializing chat info page...");
- membersList.clear();
- var chatType = chatInformation.type["@type"];
- switch(chatType) {
- case "chatTypePrivate":
- isPrivateChat = true;
- chatInformationPage.chatPartnerGroupId = chatInformation.type.user_id.toString();
- if(!privateChatUserInformation.id) {
- privateChatUserInformation = tdLibWrapper.getUserInformation(chatInformationPage.chatPartnerGroupId);
- }
- tdLibWrapper.getUserFullInfo(chatInformationPage.chatPartnerGroupId);
- tdLibWrapper.getUserProfilePhotos(chatInformationPage.chatPartnerGroupId, 100, 0);
+ onStatusChanged: {
+ switch(status) {
+ case PageStatus.Activating:
+ console.log("activating Loader")
+ mainContentLoader.active = true
break;
- case "chatTypeBasicGroup":
- isBasicGroup = true;
- chatInformationPage.chatPartnerGroupId = chatInformation.type.basic_group_id.toString();
- if(!groupInformation.id) {
- groupInformation = tdLibWrapper.getBasicGroup(chatInformationPage.chatPartnerGroupId);
- }
- tdLibWrapper.getGroupFullInfo(chatInformationPage.chatPartnerGroupId, false);
- break;
- case "chatTypeSupergroup":
- isSuperGroup = true;
- chatInformationPage.chatPartnerGroupId = chatInformation.type.supergroup_id.toString();
- if(!groupInformation.id) {
- groupInformation = tdLibWrapper.getSuperGroup(chatInformationPage.chatPartnerGroupId);
- }
-
- tdLibWrapper.getGroupFullInfo(chatInformationPage.chatPartnerGroupId, true);
- isChannel = groupInformation.is_channel;
+ case PageStatus.Active:
break;
}
- if(!isPrivateChat) {
- updateGroupStatusText();
- }
- }
- function scrollUp(force) {
- if(force) {
- // animation does not always work while quick scrolling
- scrollUpTimer.start()
- } else {
- scrollUpAnimation.start()
- }
- }
- function scrollDown(force) {
- if(force) {
- scrollDownTimer.start()
- } else {
- scrollDownAnimation.start()
- }
- }
- function handleBasicGroupFullInfo(groupFullInfo) {
- groupFullInformation = groupFullInfo;
- membersList.clear();
- if(groupFullInfo.members && groupFullInfo.members.length > 0) {
- for(var memberIndex in groupFullInfo.members) {
- var memberData = groupFullInfo.members[memberIndex];
- var userInfo = tdLibWrapper.getUserInformation(memberData.user_id) || {user:{}, bot_info:{}};
- memberData.user = userInfo;
- memberData.bot_info = memberData.bot_info || {};
- membersList.append(memberData);
- }
- groupInformation.member_count = groupFullInfo.members.length
- updateGroupStatusText();
- }
}
- Connections {
- target: tdLibWrapper
- onChatOnlineMemberCountUpdated: {
- if ((isSuperGroup || isBasicGroup) && chatInformation.id.toString() === chatId) {
- chatOnlineMemberCount = onlineMemberCount;
- updateGroupStatusText();
- }
- }
- onSupergroupFullInfoReceived: {
- if(isSuperGroup && chatInformationPage.chatPartnerGroupId === groupId) {
- groupFullInformation = groupFullInfo;
- }
- }
- onSupergroupFullInfoUpdated: {
- if(isSuperGroup && chatInformationPage.chatPartnerGroupId === groupId) {
- groupFullInformation = groupFullInfo;
- }
- }
- onBasicGroupFullInfoReceived: {
- if(isBasicGroup && chatInformationPage.chatPartnerGroupId === groupId) {
- handleBasicGroupFullInfo(groupFullInfo)
- }
- }
- onBasicGroupFullInfoUpdated: {
- if(isBasicGroup && chatInformationPage.chatPartnerGroupId === groupId) {
- handleBasicGroupFullInfo(groupFullInfo)
- }
- }
- onUserFullInfoReceived: {
- if(isPrivateChat && userFullInfo["@extra"] === chatInformationPage.chatPartnerGroupId) {
- chatPartnerFullInformation = userFullInfo;
- }
- }
- onUserFullInfoUpdated: {
- if(isPrivateChat && userId === chatInformationPage.chatPartnerGroupId) {
- chatPartnerFullInformation = userFullInfo;
- }
- }
-
- onUserProfilePhotosReceived: {
- if(isPrivateChat && extra === chatInformationPage.chatPartnerGroupId) {
- chatPartnerProfilePhotos = photos;
- }
- }
- onChatPermissionsUpdated: {
- if (chatInformation.id.toString() === chatId) {
- // set whole object to trigger change
- var newInformation = chatInformation;
- newInformation.permissions = permissions
- chatInformation = newInformation
- }
- }
- onChatTitleUpdated: {
- if (chatInformation.id.toString() === chatId) {
- // set whole object to trigger change
- var newInformation = chatInformation;
- newInformation.title = title
- chatInformation = newInformation
- }
- }
- }
- Component.onCompleted: initializePage();
-
- ListModel {
- id: membersList
- }
-
- AppNotification {
- id: infoNotification
- }
- SilicaFlickable {
- id: pageFlickable
+ Loader {
+ id: mainContentLoader
+ active: false
+ asynchronous: true
anchors.fill: parent
-
- PullDownMenu {
- MenuItem {
- visible: (chatPage.isSuperGroup || chatPage.isBasicGroup) && groupInformation && groupInformation.status["@type"] !== "chatMemberStatusBanned"
- text: userIsMember ? qsTr("Leave Chat") : qsTr("Join Chat")
- onClicked: {
- // ensure it's done even if the page is closed:
- if (userIsMember) {
- var remorse = Remorse.popupAction(appWindow, qsTr("Leaving chat"), (function(chatid) {
- return function() {
- tdLibWrapper.leaveChat(chatid);
- // this does not care about the response (ideally type "ok" without further reference) for now
- pageStack.pop(pageStack.find( function(page){ return(page._depth === 0)} ));
- };
- }(chatInformation.id)))
- } else {
- tdLibWrapper.joinChat(chatInformation.id);
- }
-
-
- }
- }
- MenuItem {
- visible: userIsMember
- onClicked: {
- var newNotificationSettings = chatInformation.notification_settings;
- if (newNotificationSettings.mute_for > 0) {
- newNotificationSettings.mute_for = 0;
- } else {
- newNotificationSettings.mute_for = 6666666;
- }
- newNotificationSettings.use_default_mute_for = false;
- tdLibWrapper.setChatNotificationSettings(chat_id, newNotificationSettings);
- }
- text: chatInformation.notification_settings.mute_for > 0 ? qsTr("Unmute Chat") : qsTr("Mute Chat")
- }
- // MenuItem { //TODO Implement
- // visible: !userIsMember
- // onClicked: {
- // tdLibWrapper.joinChat(chat_id);
- // }
- // text: qsTr("Join Chat")
- // }
- }
- // header
- PageHeader {
- id: headerItem
- z: 5
- Item {
- id: imageContainer
- property bool hasImage: typeof chatInformation.photo !== "undefined"
- property int minDimension: chatInformationPage.isLandscape ? Theme.itemSizeSmall : Theme.itemSizeMedium
- property int maxDimension: Screen.width / 2
- property int minX: Theme.horizontalPageMargin
- property int maxX: (chatInformationPage.width - maxDimension)/2
- property int minY: (parent.height - minDimension)/2
- property int maxY: parent.height
- property double tweenFactor: {
- if(!hasImage) {
- return 0
- }
- return 1 - Math.max(0, Math.min(1, contentFlickable.contentY / maxDimension))
- }
-
- function getEased(min,max,factor) {
- return min + (max-min)*factor
- }
- width: getEased(minDimension,maxDimension, tweenFactor)
- height: width
- x: getEased(minX,maxX, tweenFactor)
- y: getEased(minY,maxY, tweenFactor)
-
- ProfileThumbnail {
- id: chatPictureThumbnail
- photoData: imageContainer.hasImage ? chatInformation.photo.small : ""
- replacementStringHint: headerItem.title
- width: parent.width
- height: width
- radius: imageContainer.minDimension / 2
- opacity: profilePictureLoader.status !== Loader.Ready || profilePictureLoader.item.opacity < 1 ? 1.0 : 0.0
- optimizeImageSize: false
- }
- Loader {
- id: profilePictureLoader
- active: imageContainer.hasImage
- asynchronous: true
- anchors.fill: chatPictureThumbnail
- source: chatInformationPage.isPrivateChat
- ? "../components/chatInformationPage/ChatInformationProfilePictureList.qml"
- : "../components/chatInformationPage/ChatInformationProfilePicture.qml"
- }
- }
- // PageHeader changes the html base path:
- property url emojiBase: "../js/emoji/"
- leftMargin: imageContainer.minDimension + Theme.horizontalPageMargin + Theme.paddingMedium
- title: chatInformation.title !== "" ? Emoji.emojify(chatInformation.title, Theme.fontSizeLarge, emojiBase) : qsTr("Unknown")
- description: chatInformationPage.isPrivateChat ? ("@"+(chatInformationPage.privateChatUserInformation.username || chatInformationPage.chatPartnerGroupId)) : ""
- }
-
- SilicaFlickable {
- id: contentFlickable
- contentHeight: groupInfoItem.height + tabViewLoader.height
- clip: true
- interactive: true//groupInfoItem.height > pageFlickable.height * 0.5
-
- anchors {
- top: headerItem.bottom
- bottom: parent.bottom
- left: parent.left
- right: parent.right
- }
- NumberAnimation {
- id: scrollDownAnimation
- target: contentFlickable
- to: groupInfoItem.height
- property: "contentY"
- duration: 500
- easing.type: Easing.InOutCubic
- }
- NumberAnimation {
- id: scrollUpAnimation
- target: contentFlickable
- to: 0
- property: "contentY"
- duration: 500
- easing.type: Easing.InOutCubic
- property Timer scrollUpTimer: Timer {
- id: scrollUpTimer
- interval: 50
- onTriggered: {
- contentFlickable.scrollToTop()
- }
- }
- property Timer scrollDownTimer: Timer {
- id: scrollDownTimer
- interval: 50
- onTriggered: {
- contentFlickable.scrollToBottom()
- }
- }
- }
-
- Column {
- id: groupInfoItem
- bottomPadding: Theme.paddingLarge
- topPadding: Theme.paddingLarge
- anchors {
- top: parent.top
- left: parent.left
- leftMargin: Theme.horizontalPageMargin
- right: parent.right
- rightMargin: Theme.horizontalPageMargin
- }
-
- Item { //large image placeholder
- width: parent.width
- height: imageContainer.hasImage ? imageContainer.maxDimension : 0
- }
-
- ChatInformationEditArea {
- visible: canEdit
- canEdit: !chatInformationPage.isPrivateChat && chatInformationPage.groupInformation.status && (chatInformationPage.groupInformation.status.can_change_info || chatInformationPage.groupInformation.status["@type"] === "chatMemberStatusCreator")
- headerText: qsTr("Chat Title", "group title header")
- text: chatInformation.title
-
- onSaveButtonClicked: {
- if(!editItem.errorHighlight) {
- tdLibWrapper.setChatTitle(chatInformationPage.chatInformation.id, textValue);
- } else {
- isEditing = true
- }
- }
-
- onTextEdited: {
- if(textValue.length > 0 && textValue.length < 129) {
- editItem.errorHighlight = false
- editItem.label = ""
- editItem.placeholderText = ""
- } else {
- editItem.label = qsTr("Enter 1-128 characters")
- editItem.placeholderText = editItem.label
- editItem.errorHighlight = true
- }
- }
- }
- ChatInformationEditArea {
- canEdit: (chatInformationPage.isPrivateChat && chatInformationPage.privateChatUserInformation.id === chatInformationPage.myUserId) || ((chatInformationPage.isBasicGroup || chatInformationPage.isSuperGroup) && chatInformationPage.groupInformation && (chatInformationPage.groupInformation.status.can_change_info || chatInformationPage.groupInformation.status["@type"] === "chatMemberStatusCreator"))
- emptyPlaceholderText: qsTr("There is no information text available, yet.")
- headerText: qsTr("Info", "group or user infotext header")
- multiLine: true
- text: (chatInformationPage.isPrivateChat ? chatInformationPage.chatPartnerFullInformation.bio : chatInformationPage.groupFullInformation.description) || ""
- onSaveButtonClicked: {
- if(chatInformationPage.isPrivateChat) { // own bio
- tdLibWrapper.setBio(textValue);
- } else { // group info
- tdLibWrapper.setChatDescription(chatInformationPage.chatInformation.id, textValue);
- }
- }
- }
-
- ChatInformationTextItem {
- headerText: qsTr("Phone Number", "user phone number header")
- text: (chatInformationPage.isPrivateChat && chatInformationPage.privateChatUserInformation.phone_number ? "+"+chatInformationPage.privateChatUserInformation.phone_number : "") || ""
- isLinkedLabel: true
- }
-
- SectionHeader {
- font.pixelSize: Theme.fontSizeExtraSmall
- visible: !!inviteLinkItem.text
- height: visible ? Theme.itemSizeExtraSmall : 0
- text: qsTr("Invite Link", "header")
- x: 0
- }
-
- Row {
- width: parent.width
- visible: !!inviteLinkItem.text
- ChatInformationTextItem {
- id: inviteLinkItem
- text: !isPrivateChat ? groupFullInformation.invite_link : ""
- width: parent.width - inviteLinkButton.width
- }
- IconButton {
- id: inviteLinkButton
- icon.source: "image://theme/icon-m-clipboard"
- anchors.verticalCenter: inviteLinkItem.verticalCenter
- onClicked: {
- Clipboard.text = groupFullInformation.invite_link
- infoNotification.show(qsTr("The Invite Link has been copied to the clipboard."));
- }
- }
- }
-
- Item {
- width: parent.width
- height: Theme.paddingLarge
- }
-
- Separator {
- width: parent.width
- color: Theme.primaryColor
- horizontalAlignment: Qt.AlignHCenter
- opacity: (tabViewLoader.status === Loader.Ready && tabViewLoader.item.count > 0) ? 1.0 : 0.0
-
- Behavior on opacity { PropertyAnimation {duration: 500}}
- }
- }
-
- Loader {
- id: tabViewLoader
- asynchronous: true
- active: true
- anchors {
- left: parent.left
- right: parent.right
- top: groupInfoItem.bottom
- }
- sourceComponent: Component {
- ChatInformationTabView {
- id: tabView
- height: tabView.count > 0 ? chatInformationPage.height - headerItem.height : 0
- }
- }
- }
- }
- }
- function updateGroupStatusText() {
- if (chatOnlineMemberCount > 0) {
- headerItem.description = qsTr("%1 members, %2 online").arg(Functions.getShortenedCount(groupInformation.member_count)).arg(Functions.getShortenedCount(chatOnlineMemberCount));
- } else {
- if (isChannel) {
- headerItem.description = qsTr("%1 subscribers").arg(Functions.getShortenedCount(groupInformation.member_count));
- } else {
- headerItem.description = qsTr("%1 members").arg(Functions.getShortenedCount(groupInformation.member_count));
- }
- }
+ source: Qt.resolvedUrl("../components/chatInformationPage/ChatInformationPageContent.qml");
}
}
diff --git a/qml/pages/ChatPage.qml b/qml/pages/ChatPage.qml
index b5d89d1..9e4acf8 100644
--- a/qml/pages/ChatPage.qml
+++ b/qml/pages/ChatPage.qml
@@ -298,6 +298,8 @@ Page {
case PageStatus.Active:
if (!chatPage.isInitialized) {
chatModel.initialize(chatInformation);
+
+ pageStack.pushAttached(Qt.resolvedUrl("ChatInformationPage.qml"), { "chatInformation" : chatInformation, "privateChatUserInformation": chatPartnerInformation, "groupInformation": chatGroupInformation, "chatOnlineMemberCount": chatOnlineMemberCount});
chatPage.isInitialized = true;
}
break;
@@ -516,7 +518,7 @@ Page {
if(chatPage.state === "selectMessages") {
chatPage.selectedMessages = [];
} else {
- pageStack.push(Qt.resolvedUrl("../pages/ChatInformationPage.qml"), { "chatInformation" : chatInformation, "privateChatUserInformation": chatPartnerInformation, "groupInformation": chatGroupInformation, "chatOnlineMemberCount": chatOnlineMemberCount});
+ pageStack.navigateForward();
}
}
}
diff --git a/translations/harbour-fernschreiber-de.ts b/translations/harbour-fernschreiber-de.ts
index 19b9bff..413c482 100644
--- a/translations/harbour-fernschreiber-de.ts
+++ b/translations/harbour-fernschreiber-de.ts
@@ -96,74 +96,74 @@
- ChatInformationPage
-
-
- Stummschaltung des Chats aufheben
-
-
-
- Chat stummschalten
-
-
-
- Unbekannt
-
-
-
- Der Einladungslink wurde in die Zwischenablage kopiert.
-
+ ChatInformationPageContent
- %1 Mitglieder, %2 online
+ %1 Mitglieder, %2 online
- %1 Abonnenten
+ %1 Abonnenten
- %1 Mitglieder
+ %1 Mitglieder
+
+
+
+ Chat verlassen
+
+
+
+ Chat beitreten
- Verlasse Gruppe
+ Verlasse Chat
-
- group or user infotext header
- Info
+
+ Stummschaltung des Chats aufheben
-
- user phone number header
- Telefonnummer
+
+ Chat stummschalten
-
- header
- Einladungslink
-
-
-
- Es gibt noch keinen Informationstext.
+
+ Unbekannt
group title header
- Chattitel
+ Chattitel
- Geben Sie 1-128 Zeichen ein
+ Geben Sie 1-128 Zeichen ein
-
- Chat verlassen
+
+ Es gibt noch keinen Informationstext.
-
- Chat beitreten
+
+ group or user infotext header
+ Info
+
+
+
+ user phone number header
+ Telefonnummer
+
+
+
+ header
+ Einladungslink
+
+
+
+ Der Einladungslink wurde in die Zwischenablage kopiert.
@@ -181,16 +181,6 @@
Unbekannt
-
-
- Button: groups in common (short)
- Gruppen
-
-
-
- Button: Group Members
- Mitglieder
-
Lade Gruppenmitglieder…
@@ -209,11 +199,21 @@
- ChatInformationTabItemSettings
+ ChatInformationTabView
+
+
+ Button: groups in common (short)
+ Gruppen
+
+
+
+ Button: Group Members
+ Mitglieder
+
Button: Chat Settings
- Einstellungen
+ Einstellungen
diff --git a/translations/harbour-fernschreiber-en.ts b/translations/harbour-fernschreiber-en.ts
index 6db6a80..f99c38d 100644
--- a/translations/harbour-fernschreiber-en.ts
+++ b/translations/harbour-fernschreiber-en.ts
@@ -96,74 +96,74 @@
- ChatInformationPage
-
-
- Unmute Chat
-
-
-
- Mute Chat
-
-
-
- Unknown
-
-
-
- The Invite Link has been copied to the clipboard.
-
+ ChatInformationPageContent
- %1 members, %2 online
+ %1 members, %2 online
- %1 subscribers
+ %1 subscribers
- %1 members
+ %1 members
+
+
+
+ Leave Chat
+
+
+
+ Join Chat
- Leaving chat
+ Leaving chat
-
- group or user infotext header
- Info
+
+ Unmute Chat
-
- user phone number header
- Phone Number
+
+ Mute Chat
-
- header
- Invite Link
-
-
-
- There is no information text available, yet.
+
+ Unknown
group title header
- Chat Title
+ Chat Title
- Enter 1-128 characters
+ Enter 1-128 characters
-
- Leave Chat
+
+ There is no information text available, yet.
-
- Join Chat
+
+ group or user infotext header
+ Info
+
+
+
+ user phone number header
+ Phone Number
+
+
+
+ header
+ Invite Link
+
+
+
+ The Invite Link has been copied to the clipboard.
@@ -177,16 +177,6 @@
Unknown
-
-
- Button: groups in common (short)
- Groups
-
-
-
- Button: Group Members
- Members
-
Loading group members…
@@ -209,11 +199,21 @@
- ChatInformationTabItemSettings
+ ChatInformationTabView
+
+
+ Button: groups in common (short)
+ Groups
+
+
+
+ Button: Group Members
+ Members
+
Button: Chat Settings
- Settings
+ Settings
diff --git a/translations/harbour-fernschreiber-es.ts b/translations/harbour-fernschreiber-es.ts
index 3139783..b8e0b40 100644
--- a/translations/harbour-fernschreiber-es.ts
+++ b/translations/harbour-fernschreiber-es.ts
@@ -96,74 +96,74 @@
- ChatInformationPage
-
-
- habilitar notificación
-
-
-
- deshabilitar notificación
-
-
-
- Desconocido
-
-
-
- El enlace de invitación se ha copiado en el portapapeles.
-
+ ChatInformationPageContent
- %1 miembros, %2 en línea
+ %1 miembros, %2 en línea
- %1 suscriptores
+ %1 suscriptores
- %1 miembros
+ %1 miembros
+
+
+
+ Salir del grupo
+
+
+
+ Unirse al grupo
- Saliendo del grupo
+ Saliendo del grupo
-
- group or user infotext header
- Información
+
+ habilitar notificación
-
- user phone number header
- Número de teléfono
+
+ deshabilitar notificación
-
- header
- Enlace de invitación
-
-
-
- Aún no hay texto de información disponible.
+
+
group title header
- Título del grupo
+ Título del grupo
- Marcar los caracteres 1-128
+ Marcar los caracteres 1-128
-
- Salir del grupo
+
+ Aún no hay texto de información disponible.
-
- Unirse al grupo
+
+ group or user infotext header
+ Información
+
+
+
+ user phone number header
+ Número de teléfono
+
+
+
+ header
+ Enlace de invitación
+
+
+
+ El enlace de invitación se ha copiado en el portapapeles.
@@ -177,16 +177,6 @@
Desconocido
-
-
- Button: groups in common (short)
- Grupos
-
-
-
- Button: Group Members
- Miembros
-
Cargando miembros del grupo…
@@ -209,11 +199,21 @@
- ChatInformationTabItemSettings
+ ChatInformationTabView
+
+
+ Button: groups in common (short)
+ Grupos
+
+
+
+ Button: Group Members
+ Miembros
+
Button: Chat Settings
- Ajustes
+ Ajustes
diff --git a/translations/harbour-fernschreiber-fi.ts b/translations/harbour-fernschreiber-fi.ts
index 88eec74..fa067be 100644
--- a/translations/harbour-fernschreiber-fi.ts
+++ b/translations/harbour-fernschreiber-fi.ts
@@ -96,74 +96,74 @@
- ChatInformationPage
-
-
- Poista keskustelun vaimennus
-
-
-
- Vaimenna keskustelu
-
-
-
- Tuntematon
-
-
-
- Kutsulinkki on kopioitu leikepöydälle.
-
+ ChatInformationPageContent
- %1 jäsentä, %2 paikalla
+ %1 jäsentä, %2 paikalla
- %1 tilaajaa
+ %1 tilaajaa
- %1 jäsentä
+ %1 jäsentä
+
+
+
+ Poistu keskustelusta
+
+
+
+ Liity keskusteluun
- Poistutaan keskustelusta
+ Poistutaan keskustelusta
-
- group or user infotext header
- Tietoa
+
+ Poista keskustelun vaimennus
-
- user phone number header
- Puhelinnumero
+
+ Vaimenna keskustelu
-
- header
- Kutsulinkki
-
-
-
- Tietoa ei ole vielä saatavilla.
+
+ Tuntematon
group title header
- Keskustelun otsikko
+ Keskustelun otsikko
- Syötä 1-128 merkkiä
+ Syötä 1-128 merkkiä
-
- Poistu keskustelusta
+
+ Tietoa ei ole vielä saatavilla.
-
- Liity keskusteluun
+
+ group or user infotext header
+ Tietoa
+
+
+
+ user phone number header
+ Puhelinnumero
+
+
+
+ header
+ Kutsulinkki
+
+
+
+ Kutsulinkki on kopioitu leikepöydälle.
@@ -177,16 +177,6 @@
Tuntematon
-
-
- Button: groups in common (short)
- Ryhmät
-
-
-
- Button: Group Members
- Jäsenet
-
Ladataan ryhmän jäseniä...
@@ -209,11 +199,21 @@
- ChatInformationTabItemSettings
+ ChatInformationTabView
+
+
+ Button: groups in common (short)
+ Ryhmät
+
+
+
+ Button: Group Members
+ Jäsenet
+
Button: Chat Settings
- Asetukset
+ Asetukset
diff --git a/translations/harbour-fernschreiber-hu.ts b/translations/harbour-fernschreiber-hu.ts
index cad2d5f..be6c998 100644
--- a/translations/harbour-fernschreiber-hu.ts
+++ b/translations/harbour-fernschreiber-hu.ts
@@ -96,23 +96,7 @@
- ChatInformationPage
-
-
- Csevegés némítás feloldása
-
-
-
- Csevegés némítása
-
-
-
- Ismeretlen
-
-
-
-
-
+ ChatInformationPageContent
%1 tag, %2 online
@@ -125,10 +109,43 @@
%1 tag
+
+
+
+
+
+
+
+
+
+
+ Csevegés némítás feloldása
+
+
+
+ Csevegés némítása
+
+
+
+ Ismeretlen
+
+
+
+ group title header
+
+
+
+
+
+
+
+
+
+
group or user infotext header
@@ -145,24 +162,7 @@
-
-
-
-
-
- group title header
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -177,16 +177,6 @@
Ismeretlen
-
-
- Button: groups in common (short)
-
-
-
-
- Button: Group Members
-
-
@@ -209,7 +199,17 @@
- ChatInformationTabItemSettings
+ ChatInformationTabView
+
+
+ Button: groups in common (short)
+
+
+
+
+ Button: Group Members
+
+
Button: Chat Settings
diff --git a/translations/harbour-fernschreiber-it.ts b/translations/harbour-fernschreiber-it.ts
index 8ecedeb..64e6d4f 100644
--- a/translations/harbour-fernschreiber-it.ts
+++ b/translations/harbour-fernschreiber-it.ts
@@ -96,88 +96,78 @@
- ChatInformationPage
-
-
- Lascia chat
-
-
-
- Riattiva suoni chat
-
-
-
- Silenzia chat
-
-
-
- Sconosciuto
-
-
-
- Il link d'invito è stato copiato nella clipboard.
-
+ ChatInformationPageContent
- %1 membri, %2 online
+ %1 membri, %2 online
- %1 abbonati
+ %1 abbonati
- %1 membri
+ %1 membri
-
- group or user infotext header
- Info
+
+ Lascia chat
-
- user phone number header
- Telefono
+
+ Entra nella chat
-
- header
- Link d'invito
+
+ Lascia chat
-
- Attualmente non è disponibile nessuna informazione.
+
+ Riattiva suoni chat
+
+
+
+ Silenzia chat
+
+
+
+ Sconosciuto
group title header
- Titolo chat
+ Titolo chat
- Inserisci da 1 a 128 caratteri
+ Inserisci da 1 a 128 caratteri
-
- Lascia chat
+
+ Attualmente non è disponibile nessuna informazione.
-
- Entra nella chat
+
+ group or user infotext header
+ Info
+
+
+
+ user phone number header
+ Telefono
+
+
+
+ header
+ Link d'invito
+
+
+
+ Il link d'invito è stato copiato nella clipboard.
ChatInformationTabItemMembersGroups
-
-
- Button: groups in common (short)
- Gruppi
-
-
-
- Button: Group Members
- Membri
-
Tu
@@ -209,11 +199,21 @@
- ChatInformationTabItemSettings
+ ChatInformationTabView
+
+
+ Button: groups in common (short)
+ Gruppi
+
+
+
+ Button: Group Members
+ Membri
+
Button: Chat Settings
- Impostazioni
+ Impostazioni
diff --git a/translations/harbour-fernschreiber-pl.ts b/translations/harbour-fernschreiber-pl.ts
index ccfd65d..54bef34 100644
--- a/translations/harbour-fernschreiber-pl.ts
+++ b/translations/harbour-fernschreiber-pl.ts
@@ -96,7 +96,7 @@
- ChatInformationPage
+ ChatInformationPageContent
Wyłącz wyciszenie czatu
@@ -209,7 +209,17 @@
- ChatInformationTabItemSettings
+ ChatInformationTabView
+
+
+ Button: groups in common (short)
+
+
+
+
+ Button: Group Members
+
+
Button: Chat Settings
diff --git a/translations/harbour-fernschreiber-ru.ts b/translations/harbour-fernschreiber-ru.ts
index 34fa4c2..2872909 100644
--- a/translations/harbour-fernschreiber-ru.ts
+++ b/translations/harbour-fernschreiber-ru.ts
@@ -96,23 +96,7 @@
- ChatInformationPage
-
-
- Включить уведомления
-
-
-
- Выключить уведомления
-
-
-
-
-
-
-
- Ссылка для приглашения скопирована в буффер обмена
-
+ ChatInformationPageContent
%1 участников, %2 онлайн
@@ -125,45 +109,61 @@
%1 участников
+
+
+ Выйти из чата
+
+
+
+ Зайти в чат
+
Выход из чата
-
- group or user infotext header
- Информация
+
+ Включить уведомления
-
- user phone number header
- Номер телефона
+
+ Выключить уведомления
-
- header
- Ссылка для приглашения
-
-
-
- Информация отсутствует
+
+
group title header
- Заголовок чата
+ Заголовок чата
- Введите 1-128 символов
+ Введите 1-128 символов
-
- Выйти из чата
+
+ Информация отсутствует
-
- Зайти в чат
+
+ group or user infotext header
+ Информация
+
+
+
+ user phone number header
+ Номер телефона
+
+
+
+ header
+ Ссылка для приглашения
+
+
+
+ Ссылка для приглашения скопирована в буффер обмена
@@ -177,16 +177,6 @@
нет информации
-
-
- Button: groups in common (short)
- Группы
-
-
-
- Button: Group Members
- Участники группы
-
Загрузка списка участников…
@@ -209,11 +199,21 @@
- ChatInformationTabItemSettings
+ ChatInformationTabView
+
+
+ Button: groups in common (short)
+ Группы
+
+
+
+ Button: Group Members
+ Участники группы
+
Button: Chat Settings
- Настройки
+ Настройки
diff --git a/translations/harbour-fernschreiber-sv.ts b/translations/harbour-fernschreiber-sv.ts
index 0106fa2..8379e51 100644
--- a/translations/harbour-fernschreiber-sv.ts
+++ b/translations/harbour-fernschreiber-sv.ts
@@ -96,74 +96,74 @@
- ChatInformationPage
-
-
- Slå på chatten
-
-
-
- Stäng av chatten
-
-
-
- Okänd
-
-
-
- Inbjudningslänken har kopierats till urklipp.
-
+ ChatInformationPageContent
- %1 medlemmar, %2 inloggade
+ %1 medlem(mar), %2 inloggad(e)
- %1 prenumeranter
+ %1 prenumerant(er)
- %1 medlemmar
+ %1 medlem(mar)
+
+
+
+ Lämna chatten
+
+
+
+ Anslut till chatten
- Lämnar chatten
+ Lämnar chatten
-
- group or user infotext header
- Info
+
+ Slå på chatten
-
- user phone number header
- Telefonnummer
+
+ Stäng av chatten
-
- header
- Inbjudningslänk
-
-
-
- Det finns ingen informationstext än.
+
+ Okänd
group title header
- Chattnamn
+ Chattnamn
- Ange 1-128 tecken
+ Ange 1-128 tecken
-
- Lämna chatten
+
+ Det finns ingen informationstext än.
-
- Anslut till chatten
+
+ group or user infotext header
+ Info
+
+
+
+ user phone number header
+ Telefonnummer
+
+
+
+ header
+ Inbjudningslänk
+
+
+
+ Inbjudningslänken har kopierats till urklipp.
@@ -177,16 +177,6 @@
Okänd
-
-
- Button: groups in common (short)
- Grupper
-
-
-
- Button: Group Members
- Medlemmar
-
Läser in gruppmedlemmar...
@@ -209,11 +199,21 @@
- ChatInformationTabItemSettings
+ ChatInformationTabView
+
+
+ Button: groups in common (short)
+ Grupper
+
+
+
+ Button: Group Members
+ Medlemmar
+
Button: Chat Settings
- Inställningar
+ Inställningar
diff --git a/translations/harbour-fernschreiber-zh_CN.ts b/translations/harbour-fernschreiber-zh_CN.ts
index f93749b..05c9911 100644
--- a/translations/harbour-fernschreiber-zh_CN.ts
+++ b/translations/harbour-fernschreiber-zh_CN.ts
@@ -96,74 +96,74 @@
- ChatInformationPage
-
-
- 取消对话静音
-
-
-
- 静音对话
-
-
-
- 未知
-
-
-
- 邀请链接已复制到剪切板
-
+ ChatInformationPageContent
- %1 位成员, %2 位在线
+ %1 位成员, %2 位在线
- %1 位订阅者
+ %1 位订阅者
- %1 位成员
+ %1 位成员
+
+
+
+ 离开对话
+
+
+
+ 加入对话
- 正在离开对话
+ 正在离开对话
-
- group or user infotext header
- 信息
+
+ 取消对话静音
-
- user phone number header
- 电话号码
+
+
-
- header
- 邀请链接
-
-
-
- 暂无信息
+
+ 未知
group title header
- 对话标题
+ 对话标题
- 输入 1-128 个字符
+ 输入 1-128 个字符
-
- 离开对话
+
+ 暂无信息
-
- 加入对话
+
+ group or user infotext header
+ 信息
+
+
+
+ user phone number header
+ 电话号码
+
+
+
+ header
+ 邀请链接
+
+
+
+ 邀请链接已复制到剪切板
@@ -177,16 +177,6 @@
未知
-
-
- Button: groups in common (short)
- 群组
-
-
-
- Button: Group Members
- 成员
-
正在加载群组成员…
@@ -209,11 +199,21 @@
- ChatInformationTabItemSettings
+ ChatInformationTabView
+
+
+ Button: groups in common (short)
+ 群组
+
+
+
+ Button: Group Members
+ 成员
+
Button: Chat Settings
- 设置
+ 设置
diff --git a/translations/harbour-fernschreiber.ts b/translations/harbour-fernschreiber.ts
index 06f8cc7..4996468 100644
--- a/translations/harbour-fernschreiber.ts
+++ b/translations/harbour-fernschreiber.ts
@@ -96,23 +96,7 @@
- ChatInformationPage
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ ChatInformationPageContent
@@ -125,10 +109,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ group title header
+
+
+
+
+
+
+
+
+
+
group or user infotext header
@@ -145,24 +162,7 @@
-
-
-
-
-
- group title header
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -177,16 +177,6 @@
-
-
- Button: groups in common (short)
-
-
-
-
- Button: Group Members
-
-
@@ -209,7 +199,17 @@
- ChatInformationTabItemSettings
+ ChatInformationTabView
+
+
+ Button: groups in common (short)
+
+
+
+
+ Button: Group Members
+
+
Button: Chat Settings