diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-28 16:34:30 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-28 16:34:30 +0300 |
commit | 81ce57622c3166830b23eae534dacc6b008c659d (patch) | |
tree | 6d6ac74667f733a20b94fa27cc01c2f45688c533 /protocols/Twitter/src/main.cpp | |
parent | c2bb7727483b9b5620e8cc0ce6adae35ee78d0a4 (diff) |
common protocol instance management code went into template
Diffstat (limited to 'protocols/Twitter/src/main.cpp')
-rw-r--r-- | protocols/Twitter/src/main.cpp | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/protocols/Twitter/src/main.cpp b/protocols/Twitter/src/main.cpp index a4e714ba7e..14e91dc39e 100644 --- a/protocols/Twitter/src/main.cpp +++ b/protocols/Twitter/src/main.cpp @@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "proto.h"
#include "theme.h"
+CMPlugin g_plugin;
CLIST_INTERFACE* pcli;
HINSTANCE g_hInstance;
@@ -40,16 +41,6 @@ PLUGININFOEX pluginInfo = { { 0xbc09a71b, 0xb86e, 0x4d33, { 0xb1, 0x8d, 0x82, 0xd3, 0x4, 0x51, 0xdd, 0x3c } }
};
-/////////////////////////////////////////////////////////////////////////////
-// Protocol instances
-
-static int compare_protos(const TwitterProto *p1, const TwitterProto *p2)
-{
- return mir_wstrcmp(p1->m_tszUserName, p2->m_tszUserName);
-}
-
-OBJLIST<TwitterProto> g_Instances(1, compare_protos);
-
DWORD WINAPI DllMain(HINSTANCE hInstance, DWORD, LPVOID)
{
g_hInstance = hInstance;
@@ -87,28 +78,3 @@ extern "C" int __declspec(dllexport) Unload(void) {
return 0;
}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-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;
|