#pragma once #define _CRT_SECURE_NO_DEPRECATE 1 #define TEXT_LEN 1024 #define CP_ACP 0 #define code_page CP_ACP; #define MIRANDA_CUSTOM_LP // System includes #include #include #include #include #include #include #include #include #include #include "resource.h" #include "version.h" #include "util.h" // Miranda Includes #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // Program defines #define SKYPE_NAME "Username" #define SKYPE_PROTO "PROTOCOL 7" #define SKYPE_PROTONAME g_szProtoName // Name of our protocol, taken from .DLL name #define MAX_MSGS 128 // Maximum messages in queue #define MAX_USERLEN 32 // Maximum length of a username in Skype #define PING_INTERVAL 10000 // Ping every 10000 msec to see if Skype is still available #define USEPOPUP 1 // Use the popup-plugin? #define TIMEOUT_MSGSEND 60000 // Stolen from msgdialog.c #define MAX_MSG_AGE 30 // Maximum age in seconds before a Message from queue gets trashed #define SKYPEBUG_OFFLN 1 // Activate fix for the SkypeAPI Offline-Bug // Program hooks typedef struct { char ChatNew[MAXMODULELABELLENGTH]; char SetAvatar[MAXMODULELABELLENGTH]; char SendGuiFile[MAXMODULELABELLENGTH]; char HoldCall[MAXMODULELABELLENGTH]; char AnswerCall[MAXMODULELABELLENGTH]; char ImportHistory[MAXMODULELABELLENGTH]; char AddUser[MAXMODULELABELLENGTH]; char SkypeOutCallUser[MAXMODULELABELLENGTH]; char CallHangupUser[MAXMODULELABELLENGTH]; char CallUser[MAXMODULELABELLENGTH]; char BlockContact[MAXMODULELABELLENGTH]; } SKYPE_SVCNAMES; #define SKYPE_CALL g_svcNames.CallUser #define SKYPE_CALLHANGUP g_svcNames.CallHangupUser #define SKYPEOUT_CALL g_svcNames.SkypeOutCallUser #define SKYPE_ADDUSER g_svcNames.AddUser #define SKYPE_IMPORTHISTORY g_svcNames.ImportHistory #define SKYPE_ANSWERCALL g_svcNames.AnswerCall #define SKYPE_HOLDCALL g_svcNames.HoldCall #define SKYPE_SENDFILE g_svcNames.SendGuiFile #define SKYPE_SETAVATAR g_svcNames.SetAvatar #define SKYPE_CHATNEW g_svcNames.ChatNew #define SKYPE_BLOCKCONTACT g_svcNames.BlockContact #define EVENTTYPE_CALL 2000 #define WM_COPYDATALOCAL WM_USER+100 // WM_COPYDATA for local window communication, needed due to Win98 bug #ifndef __SKYPESVC_C__ extern SKYPE_SVCNAMES g_svcNames; #endif // Skype API Communication services #define PSS_SKYPEAPIMSG "/SendSkypeAPIMsg" #define SKYPE_REGPROXY "/RegisterProxySvc" #define MUUID_SKYPE_CALL { 0x245241eb, 0x178c, 0x4b3f, { 0x91, 0xa, 0x4c, 0x4d, 0xf0, 0xa0, 0xc3, 0xb6 } } // Common used code-pieces #define OUTPUT(a) ShowMessage(IDI_ERRORS, a, 1); #define OUTPUTA(a) ShowMessageA(IDI_ERRORS, a, 1); typedef void ( __cdecl* pThreadFunc )( void* ); // Prototypes void __cdecl SkypeSystemInit(char *); void __cdecl MsgPump (char *dummy); void PingPong(void); void CheckIfApiIsResponding(char *); void TellError(DWORD err); int ShowMessage(int, TCHAR*, int); int ShowMessageA(int iconID, char *lpzText, int mustShow); void EndCallThread(char *); void GetInfoThread(void *); int OnDetailsInit( WPARAM, LPARAM ); INT_PTR SkypeGetAvatarInfo(WPARAM wParam,LPARAM lParam); INT_PTR SkypeGetAvatarCaps(WPARAM wParam,LPARAM lParam); INT_PTR SkypeGetAwayMessage(WPARAM wParam,LPARAM lParam); int HookContactAdded(WPARAM wParam, LPARAM lParam); int HookContactDeleted(WPARAM wParam, LPARAM lParam); INT_PTR ImportHistory(WPARAM wParam, LPARAM lParam); int CreateTopToolbarButton(WPARAM wParam, LPARAM lParam); int OnModulesLoaded(WPARAM wParam, LPARAM lParam); INT_PTR SkypeSetStatus(WPARAM wParam, LPARAM lParam); INT_PTR SkypeGetStatus(WPARAM wParam, LPARAM lParam); INT_PTR SkypeGetInfo(WPARAM wParam,LPARAM lParam); INT_PTR SkypeAddToList(WPARAM wParam, LPARAM lParam); INT_PTR SkypeBasicSearch(WPARAM wParam, LPARAM lParam); INT_PTR SkypeSendMessage(WPARAM wParam, LPARAM lParam); INT_PTR SkypeRecvMessage(WPARAM wParam, LPARAM lParam); INT_PTR SkypeUserIsTyping(WPARAM wParam, LPARAM lParam); INT_PTR SkypeSendAuthRequest(WPARAM wParam, LPARAM lParam); INT_PTR SkypeRecvAuth(WPARAM wParam, LPARAM lParam); INT_PTR SkypeAuthAllow(WPARAM wParam, LPARAM lParam); INT_PTR SkypeAuthDeny(WPARAM wParam, LPARAM lParam); INT_PTR SkypeAddToListByEvent(WPARAM wParam, LPARAM lParam); INT_PTR SkypeRegisterProxy(WPARAM wParam, LPARAM lParam); time_t SkypeTime(time_t *timer); void MessageSendWatchThread(void*); int OkToExit(WPARAM wParam, LPARAM lParam); int MirandaExit(WPARAM wParam, LPARAM lParam); int __stdcall EnterBitmapFileName( char* szDest ); void CleanupNicknames(char *dummy); int InitVSApi(); int FreeVSApi(); MCONTACT GetMetaHandle(DWORD dwId); void LaunchSkypeAndSetStatusThread(void *newStatus); // Structs typedef struct { char *SkypeSetting; char *MirandaSetting; } settings_map;