From 013be2d5a2f04726228b74a9504634b6bf7ebaa3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 2 Jun 2023 18:47:36 +0300 Subject: Telegram: option to compress files during send --- protocols/Telegram/res/resource.rc | 2 ++ protocols/Telegram/src/options.cpp | 7 +++++-- protocols/Telegram/src/proto.cpp | 1 + protocols/Telegram/src/proto.h | 1 + protocols/Telegram/src/resource.h | 2 ++ 5 files changed, 11 insertions(+), 2 deletions(-) (limited to 'protocols/Telegram') diff --git a/protocols/Telegram/res/resource.rc b/protocols/Telegram/res/resource.rc index 0132cbc861..340d24eb87 100644 --- a/protocols/Telegram/res/resource.rc +++ b/protocols/Telegram/res/resource.rc @@ -94,6 +94,7 @@ BEGIN EDITTEXT IDC_DEVICE_NAME,87,60,211,12,ES_AUTOHSCROLL CONTROL "Do not open chat windows on creation",IDC_HIDECHATS, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,83,294,10 + CONTROL "Compress files on send",IDC_COMPRESS_FILES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,97,294,10 END IDD_OPTIONS_ADV DIALOGEX 0, 0, 310, 86 @@ -153,6 +154,7 @@ IDI_PREMIUM ICON "premium.ico" IDI_FORWARD ICON "forward.ico" + ///////////////////////////////////////////////////////////////////////////// // // DESIGNINFO diff --git a/protocols/Telegram/src/options.cpp b/protocols/Telegram/src/options.cpp index 38946fac9f..e1c8d89c68 100644 --- a/protocols/Telegram/src/options.cpp +++ b/protocols/Telegram/src/options.cpp @@ -21,7 +21,7 @@ along with this program. If not, see . class COptionsDlg : public CTelegramDlgBase { - CCtrlCheck chkHideChats, chkUsePopups; + CCtrlCheck chkHideChats, chkUsePopups, chkCompressFiles; CCtrlCombo cmbCountry; CCtrlEdit edtGroup, edtPhone, edtDeviceName; ptrW m_wszOldGroup; @@ -35,6 +35,7 @@ public: edtPhone(this, IDC_PHONE), edtGroup(this, IDC_DEFGROUP), edtDeviceName(this, IDC_DEVICE_NAME), + chkCompressFiles(this, IDC_COMPRESS_FILES), m_wszOldGroup(mir_wstrdup(ppro->m_wszDefaultGroup)) { CreateLink(edtPhone, ppro->m_szOwnPhone); @@ -42,8 +43,10 @@ public: CreateLink(edtDeviceName, ppro->m_wszDeviceName); CreateLink(chkHideChats, ppro->m_bHideGroupchats); - if (bFullDlg) + if (bFullDlg) { CreateLink(chkUsePopups, ppro->m_bUsePopups); + CreateLink(chkCompressFiles, ppro->m_bCompressFiles); + } cmbCountry.OnChange = Callback(this, &COptionsDlg::onChange_Country); } diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp index b5edc01e8c..c7da8568ec 100644 --- a/protocols/Telegram/src/proto.cpp +++ b/protocols/Telegram/src/proto.cpp @@ -50,6 +50,7 @@ CTelegramProto::CTelegramProto(const char* protoName, const wchar_t* userName) : m_wszDeviceName(this, "DeviceName", L"Miranda NG"), m_wszDefaultGroup(this, "DefaultGroup", L"Telegram"), m_bUsePopups(this, "UsePopups", true), + m_bCompressFiles(this, "CompressFiles", true), m_bHideGroupchats(this, "HideChats", true) { m_iOwnId = GetId(0); diff --git a/protocols/Telegram/src/proto.h b/protocols/Telegram/src/proto.h index b6b70cb2a3..eaeb187795 100644 --- a/protocols/Telegram/src/proto.h +++ b/protocols/Telegram/src/proto.h @@ -342,6 +342,7 @@ public: CMOption m_wszDeviceName; // how do you see this session in Device List CMOption m_bHideGroupchats; // do not open chat windows on creation CMOption m_bUsePopups; + CMOption m_bCompressFiles; // embed pictures & videos into a message on send CMOption m_iTimeDiff1; // set this status to m_iStatus1 after this interval of secs CMOption m_iStatus1; CMOption 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 ed4b28ca4a..f72710ca00 100644 --- a/protocols/Telegram/src/resource.h +++ b/protocols/Telegram/src/resource.h @@ -15,6 +15,7 @@ #define IDC_HIDECHATS 1003 #define IDC_POPUPS 1004 #define IDC_DEFGROUP2 1004 +#define IDC_HIDECHATS2 1004 #define IDC_DEVICE_NAME 1005 #define IDC_DIFF1 1006 #define IDC_DIFF2 1007 @@ -27,6 +28,7 @@ #define IDC_FIRST_NAME 1014 #define IDC_LAST_NAME 1015 #define IDC_CLIST 1016 +#define IDC_COMPRESS_FILES 1017 // Next default values for new objects // -- cgit v1.2.3