summaryrefslogtreecommitdiff
path: root/protocols/Telegram
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-06-02 18:47:36 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-06-02 18:47:42 +0300
commit013be2d5a2f04726228b74a9504634b6bf7ebaa3 (patch)
tree5730da86e9813549837a5a74f89f7e02ce85820d /protocols/Telegram
parent0ee9109020b70f4ae94747117cb47165b4e13b63 (diff)
Telegram: option to compress files during send
Diffstat (limited to 'protocols/Telegram')
-rw-r--r--protocols/Telegram/res/resource.rc2
-rw-r--r--protocols/Telegram/src/options.cpp7
-rw-r--r--protocols/Telegram/src/proto.cpp1
-rw-r--r--protocols/Telegram/src/proto.h1
-rw-r--r--protocols/Telegram/src/resource.h2
5 files changed, 11 insertions, 2 deletions
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 <http://www.gnu.org/licenses/>.
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<wchar_t*> m_wszDeviceName; // how do you see this session in Device List
CMOption<bool> m_bHideGroupchats; // do not open chat windows on creation
CMOption<bool> m_bUsePopups;
+ CMOption<bool> m_bCompressFiles; // embed pictures & videos into a message on send
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 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
//