From 5309dda94b33b6678afd290e8e514dd617cb8f58 Mon Sep 17 00:00:00 2001 From: Sebastian Wolf Date: Wed, 8 Dec 2021 23:57:06 +0100 Subject: [PATCH] Avoid saving drafts for deleted users, fixes #439 --- qml/pages/ChatPage.qml | 8 ++++++-- translations/harbour-fernschreiber-de.ts | 4 ++++ translations/harbour-fernschreiber-en.ts | 4 ++++ translations/harbour-fernschreiber-es.ts | 4 ++++ translations/harbour-fernschreiber-fi.ts | 4 ++++ translations/harbour-fernschreiber-fr.ts | 4 ++++ translations/harbour-fernschreiber-hu.ts | 4 ++++ translations/harbour-fernschreiber-it.ts | 4 ++++ translations/harbour-fernschreiber-pl.ts | 4 ++++ translations/harbour-fernschreiber-ru.ts | 4 ++++ translations/harbour-fernschreiber-sk.ts | 4 ++++ translations/harbour-fernschreiber-sv.ts | 4 ++++ translations/harbour-fernschreiber-zh_CN.ts | 4 ++++ translations/harbour-fernschreiber.ts | 4 ++++ 14 files changed, 58 insertions(+), 2 deletions(-) diff --git a/qml/pages/ChatPage.qml b/qml/pages/ChatPage.qml index 227fa89..9d83561 100644 --- a/qml/pages/ChatPage.qml +++ b/qml/pages/ChatPage.qml @@ -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(); diff --git a/translations/harbour-fernschreiber-de.ts b/translations/harbour-fernschreiber-de.ts index 43df792..e0441a0 100644 --- a/translations/harbour-fernschreiber-de.ts +++ b/translations/harbour-fernschreiber-de.ts @@ -530,6 +530,10 @@ Delete Chat Chat löschen + + Deleted User + Gelöschtes Konto + ChatSelectionPage diff --git a/translations/harbour-fernschreiber-en.ts b/translations/harbour-fernschreiber-en.ts index 9446265..3574c2b 100644 --- a/translations/harbour-fernschreiber-en.ts +++ b/translations/harbour-fernschreiber-en.ts @@ -530,6 +530,10 @@ Delete Chat Delete Chat + + Deleted User + Deleted User + ChatSelectionPage diff --git a/translations/harbour-fernschreiber-es.ts b/translations/harbour-fernschreiber-es.ts index 04977ce..2b147d9 100644 --- a/translations/harbour-fernschreiber-es.ts +++ b/translations/harbour-fernschreiber-es.ts @@ -530,6 +530,10 @@ Delete Chat + + Deleted User + + ChatSelectionPage diff --git a/translations/harbour-fernschreiber-fi.ts b/translations/harbour-fernschreiber-fi.ts index d8e5fea..4dc3038 100644 --- a/translations/harbour-fernschreiber-fi.ts +++ b/translations/harbour-fernschreiber-fi.ts @@ -530,6 +530,10 @@ Delete Chat + + Deleted User + + ChatSelectionPage diff --git a/translations/harbour-fernschreiber-fr.ts b/translations/harbour-fernschreiber-fr.ts index 46733a8..fd5111f 100644 --- a/translations/harbour-fernschreiber-fr.ts +++ b/translations/harbour-fernschreiber-fr.ts @@ -530,6 +530,10 @@ Delete Chat + + Deleted User + + ChatSelectionPage diff --git a/translations/harbour-fernschreiber-hu.ts b/translations/harbour-fernschreiber-hu.ts index 02b2e10..6a2ec41 100644 --- a/translations/harbour-fernschreiber-hu.ts +++ b/translations/harbour-fernschreiber-hu.ts @@ -520,6 +520,10 @@ Delete Chat + + Deleted User + + ChatSelectionPage diff --git a/translations/harbour-fernschreiber-it.ts b/translations/harbour-fernschreiber-it.ts index d0760dd..aa727c1 100644 --- a/translations/harbour-fernschreiber-it.ts +++ b/translations/harbour-fernschreiber-it.ts @@ -530,6 +530,10 @@ Delete Chat + + Deleted User + + ChatSelectionPage diff --git a/translations/harbour-fernschreiber-pl.ts b/translations/harbour-fernschreiber-pl.ts index 8e93eab..3d4c95b 100644 --- a/translations/harbour-fernschreiber-pl.ts +++ b/translations/harbour-fernschreiber-pl.ts @@ -540,6 +540,10 @@ Delete Chat + + Deleted User + + ChatSelectionPage diff --git a/translations/harbour-fernschreiber-ru.ts b/translations/harbour-fernschreiber-ru.ts index 5db2811..fc0d823 100644 --- a/translations/harbour-fernschreiber-ru.ts +++ b/translations/harbour-fernschreiber-ru.ts @@ -540,6 +540,10 @@ Delete Chat + + Deleted User + + ChatSelectionPage diff --git a/translations/harbour-fernschreiber-sk.ts b/translations/harbour-fernschreiber-sk.ts index f655cdd..b6d53cb 100644 --- a/translations/harbour-fernschreiber-sk.ts +++ b/translations/harbour-fernschreiber-sk.ts @@ -540,6 +540,10 @@ Delete Chat + + Deleted User + + ChatSelectionPage diff --git a/translations/harbour-fernschreiber-sv.ts b/translations/harbour-fernschreiber-sv.ts index 79c16fb..cb46eb9 100644 --- a/translations/harbour-fernschreiber-sv.ts +++ b/translations/harbour-fernschreiber-sv.ts @@ -530,6 +530,10 @@ Delete Chat + + Deleted User + + ChatSelectionPage diff --git a/translations/harbour-fernschreiber-zh_CN.ts b/translations/harbour-fernschreiber-zh_CN.ts index 5d8c04b..bf2cfd5 100644 --- a/translations/harbour-fernschreiber-zh_CN.ts +++ b/translations/harbour-fernschreiber-zh_CN.ts @@ -520,6 +520,10 @@ Delete Chat + + Deleted User + + ChatSelectionPage diff --git a/translations/harbour-fernschreiber.ts b/translations/harbour-fernschreiber.ts index ef3bbc1..539083f 100644 --- a/translations/harbour-fernschreiber.ts +++ b/translations/harbour-fernschreiber.ts @@ -530,6 +530,10 @@ Delete Chat + + Deleted User + + ChatSelectionPage