summaryrefslogtreecommitdiff
path: root/protocols/SkypeClassic
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-01-16 17:49:54 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-01-16 17:49:54 +0000
commit85c0b6a96f366bdf0ca334ee7cb1877fb3f2288c (patch)
treefe07935255b7432938f282419c3ab1378524c02f /protocols/SkypeClassic
parent8a09c895c4cd0e9cc87c38181ae2913dba77c30b (diff)
MEVENT - the strict type for events, they are not HANDLE anymore
git-svn-id: http://svn.miranda-ng.org/main/trunk@11866 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeClassic')
-rw-r--r--protocols/SkypeClassic/src/filexfer.cpp2
-rw-r--r--protocols/SkypeClassic/src/msglist.cpp4
-rw-r--r--protocols/SkypeClassic/src/msglist.h6
-rw-r--r--protocols/SkypeClassic/src/skype.cpp18
4 files changed, 14 insertions, 16 deletions
diff --git a/protocols/SkypeClassic/src/filexfer.cpp b/protocols/SkypeClassic/src/filexfer.cpp
index 21d475460c..0c53202a83 100644
--- a/protocols/SkypeClassic/src/filexfer.cpp
+++ b/protocols/SkypeClassic/src/filexfer.cpp
@@ -114,7 +114,7 @@ INT_PTR SkypeSendFile(WPARAM, LPARAM lParam)
if (pTok) {
ret = strtoul(pTok, NULL, 10);
- TYP_MSGLENTRY *pEntry = MsgList_Add(ret, INVALID_HANDLE_VALUE);
+ TYP_MSGLENTRY *pEntry = MsgList_Add(ret, -1);
if (pEntry) {
DWORD cbSize = sizeof(PROTOFILETRANSFERSTATUS);
/* Allocate basic entry and fill some stuff we already know */
diff --git a/protocols/SkypeClassic/src/msglist.cpp b/protocols/SkypeClassic/src/msglist.cpp
index 9ba9b67679..2c33dff807 100644
--- a/protocols/SkypeClassic/src/msglist.cpp
+++ b/protocols/SkypeClassic/src/msglist.cpp
@@ -1,9 +1,9 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
+#include "filexfer.h"
#include "memlist.h"
#include "debug.h"
#include "msglist.h"
-#include "filexfer.h"
#define MSGLIST_TIMEOUT 1800 // Chatmessage references will be kept for 30 minutes
@@ -37,7 +37,7 @@ void MsgList_Exit(void)
m_hMsgList = NULL;
}
-TYP_MSGLENTRY *MsgList_Add(DWORD uMsgNum, HANDLE hEvent)
+TYP_MSGLENTRY *MsgList_Add(DWORD uMsgNum, MEVENT hEvent)
{
TYP_MSGLENTRY *pEntry;
int iListInd;
diff --git a/protocols/SkypeClassic/src/msglist.h b/protocols/SkypeClassic/src/msglist.h
index 94316c703e..d5afed9374 100644
--- a/protocols/SkypeClassic/src/msglist.h
+++ b/protocols/SkypeClassic/src/msglist.h
@@ -2,8 +2,8 @@
typedef struct {
DWORD uMsgNum;
- HANDLE hEvent;
- HANDLE hMetaEvent;
+ MEVENT hEvent;
+ MEVENT hMetaEvent;
time_t t;
time_t tEdited;
void *pfts;
@@ -11,6 +11,6 @@ typedef struct {
void MsgList_Init(void);
void MsgList_Exit(void);
-TYP_MSGLENTRY *MsgList_Add(DWORD uMsgNum, HANDLE hEvent);
+TYP_MSGLENTRY *MsgList_Add(DWORD uMsgNum, MEVENT hEvent);
TYP_MSGLENTRY *MsgList_FindMessage(DWORD uMsgNum);
void MsgList_CollectGarbage(void);
diff --git a/protocols/SkypeClassic/src/skype.cpp b/protocols/SkypeClassic/src/skype.cpp
index 2386fe528f..c9280b616f 100644
--- a/protocols/SkypeClassic/src/skype.cpp
+++ b/protocols/SkypeClassic/src/skype.cpp
@@ -868,7 +868,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) {
CCSDATA ccs = { 0 };
PROTORECVEVENT pre = { 0 };
MCONTACT hContact = NULL, hChat = NULL;
- HANDLE hDbEvent;
+ MEVENT hDbEvent;
DBEVENTINFO dbei = { 0 };
DBVARIANT dbv = { 0 };
fetchmsg_arg args;
@@ -1042,7 +1042,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) {
free_nonutf_tchar_string((void*)gcd.ptszID);
if (!args.bDontMarkSeen)
{
- MsgList_Add((DWORD)pre.lParam, INVALID_HANDLE_VALUE);
+ MsgList_Add((DWORD)pre.lParam, -1);
SkypeSend("SET %s %s SEEN", cmdMessage, args.msgnum);
}
__leave;
@@ -1169,7 +1169,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) {
bHasPartList = strncmp(msgptr, "<partlist ", 10) == 0;
if (args.pMsgEntry && args.pMsgEntry->tEdited) {
// Mark the message as edited
- if (!*msgptr && args.pMsgEntry->hEvent != INVALID_HANDLE_VALUE) {
+ if (!*msgptr && args.pMsgEntry->hEvent != -1) {
// Empty message and edited -> Delete event
if ((int)(hContact = db_event_getContact(args.pMsgEntry->hEvent)) != -1) {
db_event_delete(hContact, args.pMsgEntry->hEvent);
@@ -1273,7 +1273,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) {
gce.ptszText = (TCHAR*)(msgptr + msglen);
gce.dwFlags = GCEF_ADDTOLOG;
CallService(MS_GC_EVENT, 0, (LPARAM)&gce);
- MsgList_Add((DWORD)pre.lParam, INVALID_HANDLE_VALUE); // Mark as groupchat
+ MsgList_Add((DWORD)pre.lParam, -1); // Mark as groupchat
if (ci.pszVal) mir_free(ci.pszVal);
free_nonutf_tchar_string((void*)gce.ptszUID);
free_nonutf_tchar_string((void*)gcd.ptszID);
@@ -1612,7 +1612,7 @@ l_exitRT:
void EndCallThread(char *szSkypeMsg) {
MCONTACT hContact = NULL;
- HANDLE hDbEvent;
+ MEVENT hDbEvent;
DBEVENTINFO dbei = { 0 };
DBVARIANT dbv;
@@ -2675,7 +2675,7 @@ void MessageSendWatchThread(void *a) {
if ((ptr=strtok_r(str, " ", &nexttoken)) && (*ptr!='#' || (ptr=strtok_r(NULL, " ", &nexttoken))) &&
(ptr=strtok_r(NULL, " ", &nexttoken))) {
/* Use this to ensure that main thread doesn't pick up sent message */
- MsgList_Add(strtoul(ptr, NULL, 10), INVALID_HANDLE_VALUE);
+ MsgList_Add(strtoul(ptr, NULL, 10), -1);
#ifdef USE_REAL_TS
if (err=SkypeGet (cmdMessage, ptr, "TIMESTAMP")) {
m_AddEventArg.hContact = arg->hContact;
@@ -2847,15 +2847,13 @@ char *__skypeauth(WPARAM wParam) {
DBEVENTINFO dbei = { 0 };
dbei.cbSize = sizeof(dbei);
- if (((dbei.cbBlob = db_event_getBlobSize((HANDLE)wParam)) == -1 ||
+ if (((dbei.cbBlob = db_event_getBlobSize(wParam)) == -1 ||
!(dbei.pBlob = (unsigned char*)malloc(dbei.cbBlob))))
{
return NULL;
}
- if (db_event_get((HANDLE)wParam, &dbei) ||
- dbei.eventType != EVENTTYPE_AUTHREQUEST ||
- strcmp(dbei.szModule, SKYPE_PROTONAME))
+ if (db_event_get(wParam, &dbei) || dbei.eventType != EVENTTYPE_AUTHREQUEST || strcmp(dbei.szModule, SKYPE_PROTONAME))
{
free(dbei.pBlob);
return NULL;