Avoid saving drafts for deleted users, fixes #439

This commit is contained in:
Sebastian Wolf 2021-12-08 23:57:06 +01:00
parent 02573e8d4e
commit 5309dda94b
No known key found for this signature in database
GPG key ID: CEA9522B5F38A90A
14 changed files with 58 additions and 2 deletions

View file

@ -44,6 +44,7 @@ Page {
property bool isBasicGroup: false;
property bool isSuperGroup: false;
property bool isChannel: false;
property bool isDeletedUser: false;
property bool containsSponsoredMessages: false;
property var chatPartnerInformation;
property var botInformation;
@ -117,10 +118,13 @@ Page {
statusText += secretChatStatus;
}
}
if (statusText) {
chatStatusText.text = statusText;
}
if (chatPartnerInformation.type['@type'] === "userTypeDeleted") {
chatNameText.text = qsTr("Deleted User");
chatPage.isDeletedUser = true;
}
}
function updateGroupStatusText() {
@ -433,7 +437,7 @@ Page {
}
Component.onDestruction: {
if (chatPage.canSendMessages) {
if (chatPage.canSendMessages && !chatPage.isDeletedUser) {
tdLibWrapper.setChatDraftMessage(chatInformation.id, 0, newMessageColumn.replyToMessageId, newMessageTextField.text);
}
fernschreiberUtils.stopGeoLocationUpdates();

View file

@ -530,6 +530,10 @@
<source>Delete Chat</source>
<translation>Chat löschen</translation>
</message>
<message>
<source>Deleted User</source>
<translation>Gelöschtes Konto</translation>
</message>
</context>
<context>
<name>ChatSelectionPage</name>

View file

@ -530,6 +530,10 @@
<source>Delete Chat</source>
<translation>Delete Chat</translation>
</message>
<message>
<source>Deleted User</source>
<translation>Deleted User</translation>
</message>
</context>
<context>
<name>ChatSelectionPage</name>

View file

@ -530,6 +530,10 @@
<source>Delete Chat</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Deleted User</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatSelectionPage</name>

View file

@ -530,6 +530,10 @@
<source>Delete Chat</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Deleted User</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatSelectionPage</name>

View file

@ -530,6 +530,10 @@
<source>Delete Chat</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Deleted User</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatSelectionPage</name>

View file

@ -520,6 +520,10 @@
<source>Delete Chat</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Deleted User</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatSelectionPage</name>

View file

@ -530,6 +530,10 @@
<source>Delete Chat</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Deleted User</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatSelectionPage</name>

View file

@ -540,6 +540,10 @@
<source>Delete Chat</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Deleted User</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatSelectionPage</name>

View file

@ -540,6 +540,10 @@
<source>Delete Chat</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Deleted User</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatSelectionPage</name>

View file

@ -540,6 +540,10 @@
<source>Delete Chat</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Deleted User</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatSelectionPage</name>

View file

@ -530,6 +530,10 @@
<source>Delete Chat</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Deleted User</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatSelectionPage</name>

View file

@ -520,6 +520,10 @@
<source>Delete Chat</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Deleted User</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatSelectionPage</name>

View file

@ -530,6 +530,10 @@
<source>Delete Chat</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Deleted User</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatSelectionPage</name>