summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Telegram/res/resource.rc2
-rw-r--r--protocols/Telegram/src/options.cpp4
-rw-r--r--protocols/Telegram/src/proto.cpp8
-rw-r--r--protocols/Telegram/src/proto.h1
-rw-r--r--protocols/Telegram/src/resource.h1
5 files changed, 12 insertions, 4 deletions
diff --git a/protocols/Telegram/res/resource.rc b/protocols/Telegram/res/resource.rc
index 0cd1ca5984..22c3e324b9 100644
--- a/protocols/Telegram/res/resource.rc
+++ b/protocols/Telegram/res/resource.rc
@@ -101,6 +101,8 @@ BEGIN
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,109,294,10
CONTROL "Do not store channel history in the database",IDC_RESIDENT_CHANNELS,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,122,294,10
+ CONTROL "Delete contacts in Miranda when they are deleted from server",IDC_DELETE_CONTACTS,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,135,294,10
END
IDD_OPTIONS_ADV DIALOGEX 0, 0, 310, 86
diff --git a/protocols/Telegram/src/options.cpp b/protocols/Telegram/src/options.cpp
index c326e2925b..04a741e829 100644
--- a/protocols/Telegram/src/options.cpp
+++ b/protocols/Telegram/src/options.cpp
@@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
class COptionsDlg : public CTelegramDlgBase
{
CCtrlButton btnLogout;
- CCtrlCheck chkHideChats, chkCompressFiles, chkIncludePreviews, chkResidentChannels;
+ CCtrlCheck chkHideChats, chkCompressFiles, chkIncludePreviews, chkResidentChannels, chkDeleteContacts;
CCtrlCombo cmbCountry;
CCtrlEdit edtGroup, edtPhone, edtDeviceName;
ptrW m_wszOldGroup;
@@ -37,6 +37,7 @@ public:
edtGroup(this, IDC_DEFGROUP),
edtDeviceName(this, IDC_DEVICE_NAME),
chkCompressFiles(this, IDC_COMPRESS_FILES),
+ chkDeleteContacts(this, IDC_DELETE_CONTACTS),
chkIncludePreviews(this, IDC_USE_PREVIEW),
chkResidentChannels(this, IDC_RESIDENT_CHANNELS),
m_wszOldGroup(mir_wstrdup(ppro->m_wszDefaultGroup))
@@ -48,6 +49,7 @@ public:
if (bFullDlg) {
CreateLink(chkCompressFiles, ppro->m_bCompressFiles);
+ CreateLink(chkDeleteContacts, ppro->m_bDeleteContacts);
CreateLink(chkIncludePreviews, ppro->m_bIncludePreviews);
CreateLink(chkResidentChannels, ppro->m_bResidentChannels);
}
diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp
index a1678331d2..6e59c6c983 100644
--- a/protocols/Telegram/src/proto.cpp
+++ b/protocols/Telegram/src/proto.cpp
@@ -60,6 +60,7 @@ CTelegramProto::CTelegramProto(const char* protoName, const wchar_t* userName) :
m_bUsePopups(this, "UsePopups", true),
m_bCompressFiles(this, "CompressFiles", true),
m_bHideGroupchats(this, "HideChats", true),
+ m_bDeleteContacts(this, "DeleteContacts", false),
m_bIncludePreviews(this, "IncludePreview", true),
m_bResidentChannels(this, "ResidentChannels", false)
{
@@ -196,9 +197,10 @@ void CTelegramProto::OnShutdown()
{
m_bTerminated = true;
- for (auto &cc : m_arUsers)
- if (cc->isBot && !cc->chatId && cc->hContact != INVALID_CONTACT_ID)
- Contact::RemoveFromList(cc->hContact);
+ if (m_bDeleteContacts)
+ for (auto &cc : m_arUsers)
+ if (cc->isBot && !cc->chatId && cc->hContact != INVALID_CONTACT_ID)
+ Contact::RemoveFromList(cc->hContact);
}
int CTelegramProto::OnWindowEvent(WPARAM wParam, LPARAM lParam)
diff --git a/protocols/Telegram/src/proto.h b/protocols/Telegram/src/proto.h
index 57eb9a2f35..f00e59353f 100644
--- a/protocols/Telegram/src/proto.h
+++ b/protocols/Telegram/src/proto.h
@@ -457,6 +457,7 @@ public:
CMOption<bool> m_bIncludePreviews; // include URL previews into message text
CMOption<bool> m_bResidentChannels; // don't store channel messages in a database
CMOption<bool> m_bCompressFiles; // embed pictures & videos into a message on send
+ CMOption<bool> m_bDeleteContacts; // delete contacts from Miranda when they are deleted from server
CMOption<uint32_t> m_iTimeDiff1; // set this status to m_iStatus1 after this interval of secs
CMOption<uint32_t> m_iStatus1;
CMOption<uint32_t> m_iTimeDiff2; // set this status to m_iStatus2 after this interval of secs
diff --git a/protocols/Telegram/src/resource.h b/protocols/Telegram/src/resource.h
index b916cc8bec..7f1fda4af3 100644
--- a/protocols/Telegram/src/resource.h
+++ b/protocols/Telegram/src/resource.h
@@ -18,6 +18,7 @@
#define IDC_PHONE 1001
#define IDC_DEFGROUP 1002
#define IDC_HIDECHATS 1003
+#define IDC_DELETE_CONTACTS 1004
#define IDC_DEVICE_NAME 1005
#define IDC_DIFF1 1006
#define IDC_DIFF2 1007