summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Skype/src/skype_utils.cpp')
-rw-r--r--protocols/Skype/src/skype_utils.cpp57
1 files changed, 53 insertions, 4 deletions
diff --git a/protocols/Skype/src/skype_utils.cpp b/protocols/Skype/src/skype_utils.cpp
index 1f218dfc08..66529fb097 100644
--- a/protocols/Skype/src/skype_utils.cpp
+++ b/protocols/Skype/src/skype_utils.cpp
@@ -12,15 +12,64 @@ void CSkypeProto::Log(const char* fmt, ...)
CallService(MS_NETLIB_LOG, (WPARAM)this->hNetlibUser, (LPARAM)msg);
}
+void CSkypeProto::CreateService(const char* szService, SkypeServiceFunc serviceProc)
+{
+ char moduleName[MAXMODULELABELLENGTH];
+
+ mir_snprintf(moduleName, sizeof(moduleName), "%s%s", this->m_szModuleName, szService);
+ CreateServiceFunctionObj(moduleName, (MIRANDASERVICEOBJ)*(void**)&serviceProc, this);
+}
+
+void CSkypeProto::CreateServiceParam(const char* szService, SkypeServiceFunc serviceProc, LPARAM lParam)
+{
+ char moduleName[MAXMODULELABELLENGTH];
+
+ mir_snprintf(moduleName, sizeof(moduleName), "%s%s", this->m_szModuleName, szService);
+ CreateServiceFunctionObjParam(moduleName, (MIRANDASERVICEOBJPARAM)*(void**)&serviceProc, this, lParam);
+}
+
+HANDLE CSkypeProto::CreateHookableEvent(const char* szService)
+{
+ char moduleName[MAXMODULELABELLENGTH];
+
+ mir_snprintf(moduleName, sizeof(moduleName), "%s%s", this->m_szModuleName, szService);
+ return CreateHookableEvent(moduleName);
+}
+
void CSkypeProto::HookEvent(const char* szEvent, SkypeEventFunc handler)
{
HookEventObj(szEvent, (MIRANDAHOOKOBJ)*( void**)&handler, this);
}
-void CSkypeProto::CreateService(const char* szService, SkypeServiceFunc serviceProc)
+int CSkypeProto::SendBroadcast(HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam)
{
- char temp[MAX_PATH*2];
+ ACKDATA ack = {0};
+ ack.cbSize = sizeof(ACKDATA);
+ ack.szModule = m_szModuleName;
+ ack.hContact = hContact;
+ ack.type = type;
+ ack.result = result;
+ ack.hProcess = hProcess;
+ ack.lParam = lParam;
+ return CallService(MS_PROTO_BROADCASTACK, 0, (LPARAM)&ack);
+}
- mir_snprintf(temp, sizeof(temp), "%s%s", this->m_szModuleName, szService);
- CreateServiceFunctionObj(temp, (MIRANDASERVICEOBJ)*(void**)&serviceProc, this);
+void CSkypeProto::ForkThread(SkypeThreadFunc pFunc, void *param)
+{
+ UINT threadID;
+ CloseHandle((HANDLE)mir_forkthreadowner(
+ (pThreadFuncOwner)*(void**)&pFunc,
+ this,
+ param,
+ &threadID));
+}
+
+HANDLE CSkypeProto::ForkThreadEx(SkypeThreadFunc pFunc, void *param, UINT* threadID)
+{
+ UINT lthreadID;
+ return (HANDLE)mir_forkthreadowner(
+ (pThreadFuncOwner)*(void**)&pFunc,
+ this,
+ param,
+ threadID ? threadID : &lthreadID);
} \ No newline at end of file