Add option to delete private chat, see #439
This commit is contained in:
parent
c509616db9
commit
02573e8d4e
16 changed files with 128 additions and 0 deletions
|
@ -837,6 +837,20 @@ Page {
|
||||||
|
|
||||||
PullDownMenu {
|
PullDownMenu {
|
||||||
visible: chatInformation.id !== chatPage.myUserId && !stickerPickerLoader.active && !voiceNoteOverlayLoader.active && !messageOverlayLoader.active && !stickerSetOverlayLoader.active
|
visible: chatInformation.id !== chatPage.myUserId && !stickerPickerLoader.active && !voiceNoteOverlayLoader.active && !messageOverlayLoader.active && !stickerSetOverlayLoader.active
|
||||||
|
|
||||||
|
MenuItem {
|
||||||
|
id: deleteChatMenuItem
|
||||||
|
visible: chatPage.isPrivateChat
|
||||||
|
onClicked: {
|
||||||
|
var privateChatId = chatInformation.id;
|
||||||
|
Remorse.popupAction(chatPage, qsTr("Deleting chat"), function() {
|
||||||
|
tdLibWrapper.deleteChat(privateChatId);
|
||||||
|
pageStack.pop(pageStack.find( function(page){ return(page._depth === 0)} ));
|
||||||
|
}, 10000);
|
||||||
|
}
|
||||||
|
text: qsTr("Delete Chat")
|
||||||
|
}
|
||||||
|
|
||||||
MenuItem {
|
MenuItem {
|
||||||
id: closeSecretChatMenuItem
|
id: closeSecretChatMenuItem
|
||||||
visible: chatPage.isSecretChat && chatPage.secretChatDetails.state["@type"] !== "secretChatStateClosed"
|
visible: chatPage.isSecretChat && chatPage.secretChatDetails.state["@type"] !== "secretChatStateClosed"
|
||||||
|
|
|
@ -311,6 +311,15 @@ void TDLibWrapper::leaveChat(const QString &chatId)
|
||||||
this->sendRequest(requestObject);
|
this->sendRequest(requestObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TDLibWrapper::deleteChat(qlonglong chatId)
|
||||||
|
{
|
||||||
|
LOG("Deleting chat " << chatId);
|
||||||
|
QVariantMap requestObject;
|
||||||
|
requestObject.insert(_TYPE, "deleteChat");
|
||||||
|
requestObject.insert(CHAT_ID, chatId);
|
||||||
|
this->sendRequest(requestObject);
|
||||||
|
}
|
||||||
|
|
||||||
void TDLibWrapper::getChatHistory(qlonglong chatId, qlonglong fromMessageId, int offset, int limit, bool onlyLocal)
|
void TDLibWrapper::getChatHistory(qlonglong chatId, qlonglong fromMessageId, int offset, int limit, bool onlyLocal)
|
||||||
{
|
{
|
||||||
LOG("Retrieving chat history" << chatId << fromMessageId << offset << limit << onlyLocal);
|
LOG("Retrieving chat history" << chatId << fromMessageId << offset << limit << onlyLocal);
|
||||||
|
|
|
@ -156,6 +156,7 @@ public:
|
||||||
Q_INVOKABLE void closeChat(const QString &chatId);
|
Q_INVOKABLE void closeChat(const QString &chatId);
|
||||||
Q_INVOKABLE void joinChat(const QString &chatId);
|
Q_INVOKABLE void joinChat(const QString &chatId);
|
||||||
Q_INVOKABLE void leaveChat(const QString &chatId);
|
Q_INVOKABLE void leaveChat(const QString &chatId);
|
||||||
|
Q_INVOKABLE void deleteChat(qlonglong chatId);
|
||||||
Q_INVOKABLE void getChatHistory(qlonglong chatId, qlonglong fromMessageId = 0, int offset = -1, int limit = 50, bool onlyLocal = false);
|
Q_INVOKABLE void getChatHistory(qlonglong chatId, qlonglong fromMessageId = 0, int offset = -1, int limit = 50, bool onlyLocal = false);
|
||||||
Q_INVOKABLE void viewMessage(const QString &chatId, const QString &messageId, bool force);
|
Q_INVOKABLE void viewMessage(const QString &chatId, const QString &messageId, bool force);
|
||||||
Q_INVOKABLE void viewSponsoredMessage(qlonglong chatId, qlonglong messageId);
|
Q_INVOKABLE void viewSponsoredMessage(qlonglong chatId, qlonglong messageId);
|
||||||
|
|
|
@ -522,6 +522,14 @@
|
||||||
<source>Sponsored Message</source>
|
<source>Sponsored Message</source>
|
||||||
<translation>Gesponsorte Nachricht</translation>
|
<translation>Gesponsorte Nachricht</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Deleting chat</source>
|
||||||
|
<translation>Lösche Chat</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Delete Chat</source>
|
||||||
|
<translation>Chat löschen</translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ChatSelectionPage</name>
|
<name>ChatSelectionPage</name>
|
||||||
|
|
|
@ -522,6 +522,14 @@
|
||||||
<source>Sponsored Message</source>
|
<source>Sponsored Message</source>
|
||||||
<translation>Sponsored Message</translation>
|
<translation>Sponsored Message</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Deleting chat</source>
|
||||||
|
<translation>Deleting chat</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Delete Chat</source>
|
||||||
|
<translation>Delete Chat</translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ChatSelectionPage</name>
|
<name>ChatSelectionPage</name>
|
||||||
|
|
|
@ -522,6 +522,14 @@
|
||||||
<source>Sponsored Message</source>
|
<source>Sponsored Message</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Deleting chat</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Delete Chat</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ChatSelectionPage</name>
|
<name>ChatSelectionPage</name>
|
||||||
|
|
|
@ -522,6 +522,14 @@
|
||||||
<source>Sponsored Message</source>
|
<source>Sponsored Message</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Deleting chat</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Delete Chat</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ChatSelectionPage</name>
|
<name>ChatSelectionPage</name>
|
||||||
|
|
|
@ -522,6 +522,14 @@
|
||||||
<source>Sponsored Message</source>
|
<source>Sponsored Message</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Deleting chat</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Delete Chat</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ChatSelectionPage</name>
|
<name>ChatSelectionPage</name>
|
||||||
|
|
|
@ -512,6 +512,14 @@
|
||||||
<source>Sponsored Message</source>
|
<source>Sponsored Message</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Deleting chat</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Delete Chat</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ChatSelectionPage</name>
|
<name>ChatSelectionPage</name>
|
||||||
|
|
|
@ -522,6 +522,14 @@
|
||||||
<source>Sponsored Message</source>
|
<source>Sponsored Message</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Deleting chat</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Delete Chat</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ChatSelectionPage</name>
|
<name>ChatSelectionPage</name>
|
||||||
|
|
|
@ -532,6 +532,14 @@
|
||||||
<source>Sponsored Message</source>
|
<source>Sponsored Message</source>
|
||||||
<translation>Wiadomość sponsorowana</translation>
|
<translation>Wiadomość sponsorowana</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Deleting chat</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Delete Chat</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ChatSelectionPage</name>
|
<name>ChatSelectionPage</name>
|
||||||
|
|
|
@ -532,6 +532,14 @@
|
||||||
<source>Sponsored Message</source>
|
<source>Sponsored Message</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Deleting chat</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Delete Chat</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ChatSelectionPage</name>
|
<name>ChatSelectionPage</name>
|
||||||
|
|
|
@ -532,6 +532,14 @@
|
||||||
<source>Sponsored Message</source>
|
<source>Sponsored Message</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Deleting chat</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Delete Chat</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ChatSelectionPage</name>
|
<name>ChatSelectionPage</name>
|
||||||
|
|
|
@ -522,6 +522,14 @@
|
||||||
<source>Sponsored Message</source>
|
<source>Sponsored Message</source>
|
||||||
<translation>Reklammeddelande</translation>
|
<translation>Reklammeddelande</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Deleting chat</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Delete Chat</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ChatSelectionPage</name>
|
<name>ChatSelectionPage</name>
|
||||||
|
|
|
@ -512,6 +512,14 @@
|
||||||
<source>Sponsored Message</source>
|
<source>Sponsored Message</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Deleting chat</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Delete Chat</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ChatSelectionPage</name>
|
<name>ChatSelectionPage</name>
|
||||||
|
|
|
@ -522,6 +522,14 @@
|
||||||
<source>Sponsored Message</source>
|
<source>Sponsored Message</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Deleting chat</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Delete Chat</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ChatSelectionPage</name>
|
<name>ChatSelectionPage</name>
|
||||||
|
|
Loading…
Reference in a new issue