summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-03-28 14:29:31 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-03-28 14:29:31 +0300
commita905c9c3f92fd54f37a5466649ac378db69e7cb0 (patch)
tree87a60dadfbf9fd8d916ea9100c26b6e314293242 /protocols/VKontakte/src
parentd75fed3bfc9c252f5d20b889e0bec95fb0a4527e (diff)
all protocols rewritten to CMPluginBase
Diffstat (limited to 'protocols/VKontakte/src')
-rw-r--r--protocols/VKontakte/src/main.cpp47
-rw-r--r--protocols/VKontakte/src/stdafx.h1
2 files changed, 26 insertions, 22 deletions
diff --git a/protocols/VKontakte/src/main.cpp b/protocols/VKontakte/src/main.cpp
index dd9687a554..1db46892eb 100644
--- a/protocols/VKontakte/src/main.cpp
+++ b/protocols/VKontakte/src/main.cpp
@@ -54,33 +54,12 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC
/////////////////////////////////////////////////////////////////////////////////////////
// OnLoad - initialize the plugin instance
-static CVkProto* vkProtoInit(const char *pszProtoName, const wchar_t *wszUserName)
-{
- CVkProto *ppro = new CVkProto(pszProtoName, wszUserName);
- return ppro;
-}
-
-static int vkProtoUninit(CVkProto *ppro)
-{
- delete ppro;
- return 0;
-}
-
extern "C" int __declspec(dllexport) Load()
{
mir_getLP(&pluginInfo);
pcli = Clist_GetInterface();
InitIcons();
-
- // Register protocol module
- PROTOCOLDESCRIPTOR pd = { 0 };
- pd.cbSize = sizeof(pd);
- pd.szName = "VKontakte";
- pd.fnInit = (pfnInitProto)vkProtoInit;
- pd.fnUninit = (pfnUninitProto)vkProtoUninit;
- pd.type = PROTOTYPE_PROTOCOL;
- Proto_RegisterModule(&pd);
return 0;
}
@@ -90,4 +69,28 @@ extern "C" int __declspec(dllexport) Load()
extern "C" int __declspec(dllexport) Unload(void)
{
return 0;
-} \ No newline at end of file
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static PROTO_INTERFACE* protoInit(const char *pszProtoName, const wchar_t *wszUserName)
+{
+ CVkProto *ppro = new CVkProto(pszProtoName, wszUserName);
+ return ppro;
+}
+
+static int protoUninit(PROTO_INTERFACE *ppro)
+{
+ delete (CVkProto*)ppro;
+ return 0;
+}
+
+struct CMPlugin : public CMPluginBase
+{
+ CMPlugin() :
+ CMPluginBase("VKontakte")
+ {
+ RegisterProtocol(PROTOTYPE_PROTOCOL, protoInit, protoUninit);
+ }
+}
+ g_plugin;
diff --git a/protocols/VKontakte/src/stdafx.h b/protocols/VKontakte/src/stdafx.h
index 148637c0a0..5af8993529 100644
--- a/protocols/VKontakte/src/stdafx.h
+++ b/protocols/VKontakte/src/stdafx.h
@@ -48,6 +48,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <m_userinfo.h>
#include <m_proto_listeningto.h>
#include <m_gui.h>
+#include <m_plugin.h>
#include <m_messagestate.h>
#include <m_popup.h>