Chat Information Page: Improvements for channels

This commit is contained in:
Sebastian Wolf 2020-11-02 22:51:12 +01:00
parent f7738e5178
commit 5ee71dda29
13 changed files with 47 additions and 6 deletions

View file

@ -30,12 +30,11 @@ ChatInformationTabItemBase {
title: chatInformationPage.isPrivateChat ? qsTr("Groups", "Button: groups in common (short)") : qsTr("Members", "Button: Group Members") title: chatInformationPage.isPrivateChat ? qsTr("Groups", "Button: groups in common (short)") : qsTr("Members", "Button: Group Members")
image: "image://theme/icon-m-people" image: "image://theme/icon-m-people"
loadingText: isPrivateChat ? qsTr("Loading common chats…", "chats you have in common with a user") : qsTr("Loading group members…") loadingText: isPrivateChat ? qsTr("Loading common chats…", "chats you have in common with a user") : qsTr("Loading group members…")
loading: chatInformationPage.isSuperGroup || chatInformationPage.isPrivateChat loading: ( chatInformationPage.isSuperGroup || chatInformationPage.isPrivateChat) && !chatInformationPage.isChannel
loadingVisible: loading && membersView.count === 0 loadingVisible: loading && membersView.count === 0
property variant chatPartnerCommonGroupsIds: ([]); property variant chatPartnerCommonGroupsIds: ([]);
SilicaListView { SilicaListView {
id: membersView id: membersView
model: isPrivateChat ? (chatPartnerCommonGroupsIds.length > 0 ? delegateModel : null) : chatInformationPage.membersList model: isPrivateChat ? (chatPartnerCommonGroupsIds.length > 0 ? delegateModel : null) : chatInformationPage.membersList
@ -69,8 +68,9 @@ ChatInformationTabItemBase {
handleScrollIntoView(true) handleScrollIntoView(true)
} }
ViewPlaceholder { ViewPlaceholder {
y: Theme.paddingLarge
enabled: membersView.count === 0 enabled: membersView.count === 0
text: chatInformationPage.isPrivateChat ? qsTr("You don't have any groups in common with this user.") : qsTr("This group is empty.") text: chatInformationPage.isPrivateChat ? qsTr("You don't have any groups in common with this user.") : ( chatInformationPage.isChannel ? qsTr("Channel members are anonymous.") : qsTr("This group is empty.") )
} }
delegate: PhotoTextsListItem { delegate: PhotoTextsListItem {
pictureThumbnail { pictureThumbnail {
@ -108,7 +108,7 @@ ChatInformationTabItemBase {
id: loadMoreIndicator id: loadMoreIndicator
anchors.centerIn: parent anchors.centerIn: parent
size: BusyIndicatorSize.Small size: BusyIndicatorSize.Small
running: parent.active running: tabBase.loading
} }
} }
} }
@ -174,7 +174,7 @@ ChatInformationTabItemBase {
interval: 600 interval: 600
property int fetchLimit: 50 property int fetchLimit: 50
onTriggered: { onTriggered: {
if(isSuperGroup) { if(isSuperGroup && !isChannel) {
tabBase.loading = true tabBase.loading = true
tdLibWrapper.getSupergroupMembers(chatInformationPage.chatPartnerGroupId, fetchLimit, membersList.count); tdLibWrapper.getSupergroupMembers(chatInformationPage.chatPartnerGroupId, fetchLimit, membersList.count);
fetchLimit = 200 fetchLimit = 200

View file

@ -41,7 +41,7 @@ Item {
height: visible ? headerGrid.height : 0 height: visible ? headerGrid.height : 0
clip: true clip: true
visible: tabView.count > 1 visible: tabView.count > 0
anchors { anchors {
left: parent.left left: parent.left

View file

@ -48,5 +48,6 @@ Column {
x: Theme.horizontalPageMargin x: Theme.horizontalPageMargin
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall
color: Theme.secondaryHighlightColor color: Theme.secondaryHighlightColor
wrapMode: Text.Wrap
} }
} }

View file

@ -191,6 +191,10 @@
<source>This group is empty.</source> <source>This group is empty.</source>
<translation>Diese Gruppe ist leer.</translation> <translation>Diese Gruppe ist leer.</translation>
</message> </message>
<message>
<source>Channel members are anonymous.</source>
<translation>Mitglieder von Kanälen sind anonym.</translation>
</message>
</context> </context>
<context> <context>
<name>ChatInformationTabItemSettings</name> <name>ChatInformationTabItemSettings</name>

View file

@ -191,6 +191,10 @@
<source>This group is empty.</source> <source>This group is empty.</source>
<translation>Este grupo está vacío.</translation> <translation>Este grupo está vacío.</translation>
</message> </message>
<message>
<source>Channel members are anonymous.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ChatInformationTabItemSettings</name> <name>ChatInformationTabItemSettings</name>

View file

@ -191,6 +191,10 @@
<source>This group is empty.</source> <source>This group is empty.</source>
<translation>Tämä ryhmä on tyhjä.</translation> <translation>Tämä ryhmä on tyhjä.</translation>
</message> </message>
<message>
<source>Channel members are anonymous.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ChatInformationTabItemSettings</name> <name>ChatInformationTabItemSettings</name>

View file

@ -191,6 +191,10 @@
<source>This group is empty.</source> <source>This group is empty.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Channel members are anonymous.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ChatInformationTabItemSettings</name> <name>ChatInformationTabItemSettings</name>

View file

@ -191,6 +191,10 @@
<source>Loading group members</source> <source>Loading group members</source>
<translation>Carica membri del gruppo</translation> <translation>Carica membri del gruppo</translation>
</message> </message>
<message>
<source>Channel members are anonymous.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ChatInformationTabItemSettings</name> <name>ChatInformationTabItemSettings</name>

View file

@ -191,6 +191,10 @@
<source>This group is empty.</source> <source>This group is empty.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Channel members are anonymous.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ChatInformationTabItemSettings</name> <name>ChatInformationTabItemSettings</name>

View file

@ -191,6 +191,10 @@
<source>This group is empty.</source> <source>This group is empty.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Channel members are anonymous.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ChatInformationTabItemSettings</name> <name>ChatInformationTabItemSettings</name>

View file

@ -191,6 +191,10 @@
<source>This group is empty.</source> <source>This group is empty.</source>
<translation>Denna grupp är tom.</translation> <translation>Denna grupp är tom.</translation>
</message> </message>
<message>
<source>Channel members are anonymous.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ChatInformationTabItemSettings</name> <name>ChatInformationTabItemSettings</name>

View file

@ -191,6 +191,10 @@
<source>This group is empty.</source> <source>This group is empty.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Channel members are anonymous.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ChatInformationTabItemSettings</name> <name>ChatInformationTabItemSettings</name>

View file

@ -191,6 +191,10 @@
<source>This group is empty.</source> <source>This group is empty.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Channel members are anonymous.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ChatInformationTabItemSettings</name> <name>ChatInformationTabItemSettings</name>