From 81ce57622c3166830b23eae534dacc6b008c659d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 28 Mar 2018 16:34:30 +0300 Subject: common protocol instance management code went into template --- protocols/IRCG/src/main.cpp | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) (limited to 'protocols/IRCG/src/main.cpp') diff --git a/protocols/IRCG/src/main.cpp b/protocols/IRCG/src/main.cpp index 81ff6f6581..1dd78c6e77 100644 --- a/protocols/IRCG/src/main.cpp +++ b/protocols/IRCG/src/main.cpp @@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" #include "version.h" +CMPlugin g_plugin; CHAT_MANAGER *pci; CLIST_INTERFACE *pcli; HINSTANCE hInst = nullptr; @@ -35,13 +36,6 @@ static int CompareServers( const SERVER_INFO* p1, const SERVER_INFO* p2 ) OBJLIST g_servers( 20, CompareServers ); -static int sttCompareProtocols(const CIrcProto *p1, const CIrcProto *p2) -{ - return mir_strcmp(p1->m_szModuleName, p2->m_szModuleName); -} - -LIST g_Instances(1, sttCompareProtocols); - void UninitTimers( void ); // Information about the plugin @@ -93,29 +87,3 @@ extern "C" int __declspec(dllexport) Unload(void) UninitTimers(); return 0; } - -///////////////////////////////////////////////////////////////////////////////////////// - -static PROTO_INTERFACE* ircProtoInit(const char* pszProtoName, const wchar_t* tszUserName) -{ - CIrcProto *ppro = new CIrcProto(pszProtoName, tszUserName); - g_Instances.insert(ppro); - return ppro; -} - -static int ircProtoUninit(PROTO_INTERFACE *ppro) -{ - g_Instances.remove((CIrcProto*)ppro); - delete (CIrcProto*)ppro; - return 0; -} - -struct CMPlugin : public CMPluginBase -{ - CMPlugin() : - CMPluginBase("IRC") - { - RegisterProtocol(PROTOTYPE_PROTOCOL, ircProtoInit, ircProtoUninit); - } -} - g_plugin; -- cgit v1.2.3