diff options
Diffstat (limited to 'protocols/Skype/src')
-rw-r--r-- | protocols/Skype/src/skype.cpp | 14 | ||||
-rw-r--r-- | protocols/Skype/src/skype.h | 1 | ||||
-rw-r--r-- | protocols/Skype/src/skype_proto.cpp | 10 | ||||
-rw-r--r-- | protocols/Skype/src/skype_proto.h | 12 |
4 files changed, 22 insertions, 15 deletions
diff --git a/protocols/Skype/src/skype.cpp b/protocols/Skype/src/skype.cpp index 47e9ea0c5e..82df6a8da4 100644 --- a/protocols/Skype/src/skype.cpp +++ b/protocols/Skype/src/skype.cpp @@ -40,10 +40,9 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCO static CSkypeProto* SkypeProtoInit(const char* pszProtoName, const TCHAR* tszUserName)
{
- //CSkypeProto *ppro = new CSkypeProto(pszProtoName, tszUserName);
- //g_Instances.insert(ppro);
- //return ppro;
- return 0;
+ CSkypeProto *ppro = new CSkypeProto(pszProtoName, tszUserName);
+ g_Instances.insert(ppro);
+ return ppro;
}
static int SkypeProtoUninit(CSkypeProto* ppro)
@@ -55,14 +54,15 @@ static int SkypeProtoUninit(CSkypeProto* ppro) extern "C" int __declspec(dllexport) Load(void)
{
- //mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfo);
- PROTOCOLDESCRIPTOR pd = { sizeof(pd) };
+ PROTOCOLDESCRIPTOR pd = {0};
+ pd.cbSize = sizeof(pd);
pd.szName = "Skype";
pd.type = PROTOTYPE_PROTOCOL;
pd.fnInit = (pfnInitProto)SkypeProtoInit;
pd.fnUninit = (pfnUninitProto)SkypeProtoUninit;
- CallService(MS_PROTO_REGISTERMODULE, 0, reinterpret_cast<LPARAM>(&pd));
+ CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
return 0;
}
diff --git a/protocols/Skype/src/skype.h b/protocols/Skype/src/skype.h index bc9dc36372..df4c355ef6 100644 --- a/protocols/Skype/src/skype.h +++ b/protocols/Skype/src/skype.h @@ -22,6 +22,7 @@ #include <m_protocols.h>
#include <m_protomod.h>
#include <m_protosvc.h>
+#include <m_protoint.h>
#include <m_skin.h>
#include <statusmodes.h>
#include <m_system.h>
diff --git a/protocols/Skype/src/skype_proto.cpp b/protocols/Skype/src/skype_proto.cpp index b01329ca4e..97ebdc4f8c 100644 --- a/protocols/Skype/src/skype_proto.cpp +++ b/protocols/Skype/src/skype_proto.cpp @@ -43,4 +43,12 @@ void CSkypeProto::Log( const char* fmt, ... ) va_end(va);
CallService(MS_NETLIB_LOG, ( WPARAM )m_hNetlibUser, (LPARAM)msg);
-}
\ No newline at end of file +}
+
+void CSkypeProto::CreateProtoService(const char *szService, ServiceFunc serviceProc)
+{
+ char str[ MAXMODULELABELLENGTH ];
+ strcpy( str, m_szModuleName );
+ strcat( str, szService );
+ ::CreateServiceFunctionObj( str, ( MIRANDASERVICEOBJ )*( void** )&serviceProc, this );
+}
diff --git a/protocols/Skype/src/skype_proto.h b/protocols/Skype/src/skype_proto.h index a4613fcb3b..405d2fa907 100644 --- a/protocols/Skype/src/skype_proto.h +++ b/protocols/Skype/src/skype_proto.h @@ -1,7 +1,5 @@ -#pragma once
-
-#include "skype.h"
-#include <m_protoint.h>
+struct CSkypeProto;
+typedef INT_PTR (__cdecl CSkypeProto::*ServiceFunc)(WPARAM, LPARAM);
struct CSkypeProto : public PROTO_INTERFACE, public MZeroedObject
{
@@ -10,7 +8,7 @@ public: ~CSkypeProto();
// PROTO_INTERFACE
- /*virtual HANDLE __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
+ virtual HANDLE __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
virtual HANDLE __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent );
virtual int __cdecl Authorize( HANDLE hDbEvent );
@@ -55,10 +53,10 @@ public: virtual int __cdecl UserIsTyping( HANDLE hContact, int type );
- virtual int __cdecl OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam );*/
+ virtual int __cdecl OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam );
-protected:
HANDLE m_hNetlibUser;
void Log( const char* fmt, ... );
+ void CreateProtoService(const char* szService, ServiceFunc serviceProc);
};
\ No newline at end of file |