summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-01-24 16:16:01 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-01-24 16:16:01 +0300
commit06e159dd5fdcf09d98ca013ce7a1231bf0751205 (patch)
tree8202a379c6a5a1f1f490b8af1acd16192ba6132f
parentcf30319150edb0d5b49b05078817725c629320ba (diff)
Telegram: activating flags for deleting contact
-rw-r--r--protocols/Telegram/src/proto.cpp5
-rw-r--r--src/mir_app/src/clui.cpp5
2 files changed, 5 insertions, 5 deletions
diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp
index 9b9b9bb4f5..3b79b01e66 100644
--- a/protocols/Telegram/src/proto.cpp
+++ b/protocols/Telegram/src/proto.cpp
@@ -117,13 +117,16 @@ void CTelegramProto::OnContactAdded(MCONTACT hContact)
}
}
-bool CTelegramProto::OnContactDeleted(MCONTACT hContact, uint32_t)
+bool CTelegramProto::OnContactDeleted(MCONTACT hContact, uint32_t flags)
{
TD::int53 id = GetId(hContact);
if (id == 0)
return false;
if (auto *pUser = FindUser(id)) {
+ if (flags & CDF_DEL_HISTORY)
+ SvcEmptyServerHistory(hContact, flags);
+
if (pUser->m_si) {
SvcLeaveChat(hContact, 0);
return false;
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp
index 7af3cbcdf3..8533d95bca 100644
--- a/src/mir_app/src/clui.cpp
+++ b/src/mir_app/src/clui.cpp
@@ -217,9 +217,6 @@ static INT_PTR MenuItem_DeleteContact(WPARAM hContact, LPARAM lParam)
if (dlg.bForEveryone)
options |= CDF_FOR_EVERYONE;
- if (dlg.bDelHistory)
- CallContactService(hContact, PS_EMPTY_SRV_HISTORY, hContact, options);
-
int status = Proto_GetStatus(dlg.szProto);
if (status == ID_STATUS_OFFLINE || IsStatusConnecting(status)) {
// Set a flag so we remember to delete the contact when the protocol goes online the next time
@@ -228,7 +225,7 @@ static INT_PTR MenuItem_DeleteContact(WPARAM hContact, LPARAM lParam)
TranslateT("This contact is on an instant messaging system which stores its contact list on a central server. The contact will be removed from the server and from your contact list when you next connect to that network."),
TranslateT("Delete contact"), MB_ICONINFORMATION | MB_OK);
}
- else db_delete_contact(hContact);
+ else db_delete_contact(hContact, options);
return 0;
}