diff options
author | aunsane <aunsane@gmail.com> | 2018-04-27 21:33:17 +0300 |
---|---|---|
committer | aunsane <aunsane@gmail.com> | 2018-04-27 21:33:17 +0300 |
commit | e1ec72eab6d00b3ba38e5932bc88920f103b6e4a (patch) | |
tree | 999de2725a83e30fbbf6576200525d4ef0c5fe38 /protocols/Telegram/src | |
parent | b9ce1d4d98525490ca1a38e2d9fd4f3369adb3e0 (diff) |
Telegram: initial commit
- tdlib moved to telegram dir
Diffstat (limited to 'protocols/Telegram/src')
-rw-r--r-- | protocols/Telegram/src/main.cpp | 47 | ||||
-rw-r--r-- | protocols/Telegram/src/mt_proto.cpp | 24 | ||||
-rw-r--r-- | protocols/Telegram/src/mt_proto.h | 18 | ||||
-rw-r--r-- | protocols/Telegram/src/resource.h | 17 | ||||
-rw-r--r-- | protocols/Telegram/src/stdafx.cxx | 18 | ||||
-rw-r--r-- | protocols/Telegram/src/stdafx.h | 31 | ||||
-rw-r--r-- | protocols/Telegram/src/version.h | 13 |
7 files changed, 168 insertions, 0 deletions
diff --git a/protocols/Telegram/src/main.cpp b/protocols/Telegram/src/main.cpp new file mode 100644 index 0000000000..dd41bb61b7 --- /dev/null +++ b/protocols/Telegram/src/main.cpp @@ -0,0 +1,47 @@ +#include "stdafx.h" + +int hLangpack; + +PLUGININFOEX pluginInfo = +{ + sizeof(PLUGININFOEX), + __PLUGIN_NAME, + PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), + __DESCRIPTION, + __AUTHOR, + __COPYRIGHT, + __AUTHORWEB, + UNICODE_AWARE, + // {00272A3E-F5FA-4090-8B67-3E62AC1EE0B4} + {0x272a3e, 0xf5fa, 0x4090, {0x8b, 0x67, 0x3e, 0x62, 0xac, 0x1e, 0xe0, 0xb4}} +}; + +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) +{ + return &pluginInfo; +} + +///////////////////////////////////////////////////////////////////////////////////////// + +CMPlugin g_plugin; + +extern "C" _pfnCrtInit _pRawDllMain = &CMPlugin::RawDllMain; + +///////////////////////////////////////////////////////////////////////////////////////// + +extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST }; + +///////////////////////////////////////////////////////////////////////////////////////// + +extern "C" int __declspec(dllexport) Load(void) +{ + mir_getLP(&pluginInfo); + return 0; +} + +///////////////////////////////////////////////////////////////////////////////////////// + +extern "C" int __declspec(dllexport) Unload(void) +{ + return 0; +} diff --git a/protocols/Telegram/src/mt_proto.cpp b/protocols/Telegram/src/mt_proto.cpp new file mode 100644 index 0000000000..7766f29025 --- /dev/null +++ b/protocols/Telegram/src/mt_proto.cpp @@ -0,0 +1,24 @@ +#include "stdafx.h" + +CMTProto::CMTProto(const char* protoName, const wchar_t* userName) + : PROTO<CMTProto>(protoName, userName) +{ +} + +CMTProto::~CMTProto() +{ +} + +INT_PTR CMTProto::GetCaps(int type, MCONTACT) +{ + switch (type) { + case PFLAG_UNIQUEIDTEXT: + return (INT_PTR)"Phone"; + } + return 0; +} + +int CMTProto::SetStatus(int iNewStatus) +{ + return 0; +} diff --git a/protocols/Telegram/src/mt_proto.h b/protocols/Telegram/src/mt_proto.h new file mode 100644 index 0000000000..9626d9bda7 --- /dev/null +++ b/protocols/Telegram/src/mt_proto.h @@ -0,0 +1,18 @@ +#pragma once + +struct CMTProto : public PROTO<CMTProto> +{ +public: + ////////////////////////////////////////////////////////////////////////////////////// + // Ctors + + CMTProto(const char *protoName, const wchar_t *userName); + ~CMTProto(); + + ////////////////////////////////////////////////////////////////////////////////////// + // Virtual functions + + INT_PTR GetCaps(int type, MCONTACT hContact = NULL) override; + + int SetStatus(int iNewStatus) override; +}; diff --git a/protocols/Telegram/src/resource.h b/protocols/Telegram/src/resource.h new file mode 100644 index 0000000000..8627d4d5cd --- /dev/null +++ b/protocols/Telegram/src/resource.h @@ -0,0 +1,17 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by D:\Projects\miranda-ng\miranda-ng\protocols\Telegram\res\resource.rc +// +#define IDI_TELEGRAM 100 +#define IDD_ACCOUNT_MANAGER 110 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 111 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/protocols/Telegram/src/stdafx.cxx b/protocols/Telegram/src/stdafx.cxx new file mode 100644 index 0000000000..18ec0f9dc4 --- /dev/null +++ b/protocols/Telegram/src/stdafx.cxx @@ -0,0 +1,18 @@ +/* +Copyright (C) 2012-18 Miranda NG team (https://miranda-ng.org) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation version 2 +of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include "stdafx.h"
\ No newline at end of file diff --git a/protocols/Telegram/src/stdafx.h b/protocols/Telegram/src/stdafx.h new file mode 100644 index 0000000000..06f32c205d --- /dev/null +++ b/protocols/Telegram/src/stdafx.h @@ -0,0 +1,31 @@ +#ifndef _COMMON_H_ +#define _COMMON_H_ + +#include <windows.h> + +#include <newpluginapi.h> + +#include <m_protoint.h> +#include <m_protosvc.h> + +#include <m_database.h> +#include <m_langpack.h> + +struct CMTProto; + +#define MODULE "Telegram" + +#include "version.h" +#include "resource.h" +#include "mt_proto.h" + +struct CMPlugin : public ACCPROTOPLUGIN<CMTProto> +{ + CMPlugin() : + ACCPROTOPLUGIN<CMTProto>("TELEGRAM") + { + SetUniqueId("Phone"); + } +}; + +#endif //_COMMON_H_
\ No newline at end of file diff --git a/protocols/Telegram/src/version.h b/protocols/Telegram/src/version.h new file mode 100644 index 0000000000..7c1421b41a --- /dev/null +++ b/protocols/Telegram/src/version.h @@ -0,0 +1,13 @@ +#define __MAJOR_VERSION 0 +#define __MINOR_VERSION 11 +#define __RELEASE_NUM 0 +#define __BUILD_NUM 1 + +#include <stdver.h> + +#define __PLUGIN_NAME "Telegram protocol" +#define __FILENAME "Telegram.dll" +#define __DESCRIPTION "Telegram protocol support for Miranda NG." +#define __AUTHOR "Miranda NG team" +#define __AUTHORWEB "https://miranda-ng.org/p/TelegramTox/" +#define __COPYRIGHT "© 2018 Miranda NG team" |