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/Discord/src/main.cpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'protocols/Discord/src') diff --git a/protocols/Discord/src/main.cpp b/protocols/Discord/src/main.cpp index 2bed58e39a..9a1c6aa7dd 100644 --- a/protocols/Discord/src/main.cpp +++ b/protocols/Discord/src/main.cpp @@ -82,24 +82,11 @@ extern "C" int __declspec(dllexport) Unload(void) ///////////////////////////////////////////////////////////////////////////////////////// -static PROTO_INTERFACE* protoInit(const char *proto_name, const wchar_t *username) -{ - return new CDiscordProto(proto_name, username); -} - -static int protoUninit(PROTO_INTERFACE *proto) -{ - delete (CDiscordProto*)proto; - return 0; -} - -struct CMPlugin : public CMPluginBase +struct CMPlugin : public ACCPROTOPLUGIN { CMPlugin() : - CMPluginBase("Discord") - { - RegisterProtocol(PROTOTYPE_PROTOCOL, protoInit, protoUninit); - } + ACCPROTOPLUGIN("Discord") + {} } g_plugin; -- cgit v1.2.3