diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-28 14:29:31 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-28 14:29:31 +0300 |
commit | a905c9c3f92fd54f37a5466649ac378db69e7cb0 (patch) | |
tree | 87a60dadfbf9fd8d916ea9100c26b6e314293242 /protocols/Twitter | |
parent | d75fed3bfc9c252f5d20b889e0bec95fb0a4527e (diff) |
all protocols rewritten to CMPluginBase
Diffstat (limited to 'protocols/Twitter')
-rw-r--r-- | protocols/Twitter/src/main.cpp | 48 | ||||
-rw-r--r-- | protocols/Twitter/src/stdafx.h | 1 |
2 files changed, 27 insertions, 22 deletions
diff --git a/protocols/Twitter/src/main.cpp b/protocols/Twitter/src/main.cpp index 88c8cf1c31..a4e714ba7e 100644 --- a/protocols/Twitter/src/main.cpp +++ b/protocols/Twitter/src/main.cpp @@ -69,32 +69,11 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC /////////////////////////////////////////////////////////////////////////////////////////
// Load
-static PROTO_INTERFACE* protoInit(const char *proto_name, const wchar_t *username)
-{
- TwitterProto *proto = new TwitterProto(proto_name, username);
- g_Instances.insert(proto);
- return proto;
-}
-
-static int protoUninit(PROTO_INTERFACE *proto)
-{
- g_Instances.remove(static_cast<TwitterProto*>(proto));
- return 0;
-}
-
extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP(&pluginInfo);
pcli = Clist_GetInterface();
- PROTOCOLDESCRIPTOR pd = { 0 };
- pd.cbSize = sizeof(pd);
- pd.szName = "Twitter";
- pd.type = PROTOTYPE_PROTOCOL;
- pd.fnInit = protoInit;
- pd.fnUninit = protoUninit;
- Proto_RegisterModule(&pd);
-
InitIcons();
InitContactMenus();
TwitterInitSounds();
@@ -107,4 +86,29 @@ extern "C" int __declspec(dllexport) Load(void) extern "C" int __declspec(dllexport) Unload(void)
{
return 0;
-}
\ No newline at end of file +}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static PROTO_INTERFACE* protoInit(const char *proto_name, const wchar_t *username)
+{
+ TwitterProto *proto = new TwitterProto(proto_name, username);
+ g_Instances.insert(proto);
+ return proto;
+}
+
+static int protoUninit(PROTO_INTERFACE *proto)
+{
+ g_Instances.remove(static_cast<TwitterProto*>(proto));
+ return 0;
+}
+
+struct CMPlugin : public CMPluginBase
+{
+ CMPlugin() :
+ CMPluginBase("Twitter")
+ {
+ RegisterProtocol(PROTOTYPE_PROTOCOL, protoInit, protoUninit);
+ }
+}
+ g_plugin;
diff --git a/protocols/Twitter/src/stdafx.h b/protocols/Twitter/src/stdafx.h index 115feae40b..bda1603983 100644 --- a/protocols/Twitter/src/stdafx.h +++ b/protocols/Twitter/src/stdafx.h @@ -58,6 +58,7 @@ typedef std::basic_string<wchar_t> wstring; #include <m_icolib.h>
#include <m_utils.h>
#include <m_hotkeys.h>
+#include <m_plugin.h>
#include <m_json.h>
#include <win2k.h>
#pragma warning(pop)
|