diff options
author | George Hazan <george.hazan@gmail.com> | 2014-02-10 08:04:30 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-02-10 08:04:30 +0000 |
commit | ddba4ede6b451d0cfcd0d32b5180fbd0689966bf (patch) | |
tree | 5d74f37a7013d13b92c182628d6b68a58e148ae4 /protocols/SkypeClassic | |
parent | c39340bf493a1745a41317bbf937fc7eb6cbb26a (diff) |
- HANDLE hContact => HCONTACT
- GCF_* prefix was added to chat constants to avoid name conflicts
git-svn-id: http://svn.miranda-ng.org/main/trunk@8078 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeClassic')
-rw-r--r-- | protocols/SkypeClassic/src/contacts.cpp | 44 | ||||
-rw-r--r-- | protocols/SkypeClassic/src/contacts.h | 11 | ||||
-rw-r--r-- | protocols/SkypeClassic/src/gchat.cpp | 28 | ||||
-rw-r--r-- | protocols/SkypeClassic/src/gchat.h | 6 | ||||
-rw-r--r-- | protocols/SkypeClassic/src/skype.cpp | 111 | ||||
-rw-r--r-- | protocols/SkypeClassic/src/skype.h | 4 | ||||
-rw-r--r-- | protocols/SkypeClassic/src/skypeapi.cpp | 28 | ||||
-rw-r--r-- | protocols/SkypeClassic/src/skypeapi.h | 2 | ||||
-rw-r--r-- | protocols/SkypeClassic/src/skypeopt.cpp | 4 | ||||
-rw-r--r-- | protocols/SkypeClassic/src/voiceservice.cpp | 6 | ||||
-rw-r--r-- | protocols/SkypeClassic/src/voiceservice.h | 2 |
11 files changed, 126 insertions, 120 deletions
diff --git a/protocols/SkypeClassic/src/contacts.cpp b/protocols/SkypeClassic/src/contacts.cpp index ead7b9ffc8..127f962792 100644 --- a/protocols/SkypeClassic/src/contacts.cpp +++ b/protocols/SkypeClassic/src/contacts.cpp @@ -151,7 +151,7 @@ CLISTMENUITEM ChatInitItem(void) { return mi;
}
-HANDLE add_contextmenu(HANDLE hContact) {
+HANDLE add_contextmenu(HCONTACT hContact) {
CLISTMENUITEM mi;
UNREFERENCED_PARAMETER(hContact);
@@ -225,8 +225,8 @@ int __cdecl PrebuildContactMenu(WPARAM wParam, LPARAM lParam) { if (!strcmp(szProto, SKYPE_PROTONAME)) {
if (!HasVoiceService()) {
- if (!db_get((HANDLE)wParam, SKYPE_PROTONAME, "CallId", &dbv)) {
- if (db_get_b((HANDLE)wParam, SKYPE_PROTONAME, "OnHold", 0))
+ if (!db_get((HCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv)) {
+ if (db_get_b((HCONTACT)wParam, SKYPE_PROTONAME, "OnHold", 0))
mi=ResumeCallItem(); else mi=HoldCallItem();
mi.flags=CMIM_ALL;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuHoldCallItem,(LPARAM)&mi);
@@ -237,7 +237,7 @@ int __cdecl PrebuildContactMenu(WPARAM wParam, LPARAM lParam) { db_free(&dbv);
} else { callAvailable = TRUE; hangupAvailable = FALSE; }
- if (db_get_b((HANDLE)wParam, SKYPE_PROTONAME, "ChatRoom", 0)!=0) {
+ if (db_get_b((HCONTACT)wParam, SKYPE_PROTONAME, "ChatRoom", 0)!=0) {
callAvailable = FALSE;
hangupAvailable = FALSE;
}
@@ -259,7 +259,7 @@ int __cdecl PrebuildContactMenu(WPARAM wParam, LPARAM lParam) { // File sending and groupchat-creation works starting with protocol version 5
if (protocol>=5) {
mi=FileTransferItem();
- if (db_get_b((HANDLE)wParam, SKYPE_PROTONAME, "ChatRoom", 0)==0)
+ if (db_get_b((HCONTACT)wParam, SKYPE_PROTONAME, "ChatRoom", 0)==0)
mi.flags ^= CMIF_HIDDEN;
mi.flags |= CMIM_FLAGS;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuFileTransferItem,(LPARAM)&mi);
@@ -268,19 +268,19 @@ int __cdecl PrebuildContactMenu(WPARAM wParam, LPARAM lParam) { if (protocol>=5 || bIsImoproxy) {
mi=ChatInitItem();
if (db_get_b(NULL, SKYPE_PROTONAME, "UseGroupchat", 0) &&
- db_get_b((HANDLE)wParam, SKYPE_PROTONAME, "ChatRoom", 0)==0)
+ db_get_b((HCONTACT)wParam, SKYPE_PROTONAME, "ChatRoom", 0)==0)
mi.flags ^= CMIF_HIDDEN;
mi.flags |= CMIM_FLAGS;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuChatInitItem,(LPARAM)&mi);
}
} else if (bSkypeOut) {
- if (!db_get((HANDLE)wParam, SKYPE_PROTONAME, "CallId", &dbv)) {
+ if (!db_get((HCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv)) {
mi=SkypeOutHupItem();
db_free(&dbv);
} else {
mi=SkypeOutCallItem();
- if(!db_get((HANDLE)wParam,"UserInfo","MyPhone0",&dbv)) {
+ if(!db_get((HCONTACT)wParam,"UserInfo","MyPhone0",&dbv)) {
db_free(&dbv);
mi.flags=0;
}
@@ -306,16 +306,15 @@ int ClistDblClick(WPARAM wParam, LPARAM lParam) { }
*/
-HANDLE find_contact(char *name) {
- char *szProto;
+HCONTACT find_contact(char *name)
+{
int tCompareResult;
- HANDLE hContact;
DBVARIANT dbv;
// already on list?
- for (hContact=(HANDLE)db_find_first();hContact != NULL;hContact=db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact != NULL; hContact=db_find_next(hContact))
{
- szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0 );
+ char *szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0 );
if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME) && db_get_b(hContact, SKYPE_PROTONAME, "ChatRoom", 0)==0)
{
if (db_get_s(hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) continue;
@@ -327,16 +326,16 @@ HANDLE find_contact(char *name) { }
return NULL;
}
-HANDLE find_contactT(TCHAR *name) {
- char *szProto;
+
+HCONTACT find_contactT(TCHAR *name)
+{
int tCompareResult;
- HANDLE hContact;
DBVARIANT dbv;
// already on list?
- for (hContact=db_find_first();hContact != NULL;hContact=db_find_next(hContact))
+ for (HCONTACT hContact=db_find_first(); hContact != NULL; hContact=db_find_next(hContact))
{
- szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0 );
+ char *szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0 );
if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME) && db_get_b(hContact, SKYPE_PROTONAME, "ChatRoom", 0)==0)
{
if (db_get_ts(hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) continue;
@@ -350,8 +349,9 @@ HANDLE find_contactT(TCHAR *name) { }
-HANDLE add_contact(char *name, DWORD flags) {
- HANDLE hContact;
+HCONTACT add_contact(char *name, DWORD flags)
+{
+ HCONTACT hContact;
// already on list?
if (hContact=find_contact(name)) {
@@ -365,7 +365,7 @@ HANDLE add_contact(char *name, DWORD flags) { // no, so add
LOG(("add_contact: Adding %s", name));
- hContact=(HANDLE)CallServiceSync(MS_DB_CONTACT_ADD, 0, 0);
+ hContact=(HCONTACT)CallServiceSync(MS_DB_CONTACT_ADD, 0, 0);
if (hContact) {
if (CallServiceSync(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact,(LPARAM)SKYPE_PROTONAME)!=0) {
LOG(("add_contact: Ouch! MS_PROTO_ADDTOCONTACT failed for some reason"));
@@ -387,7 +387,7 @@ HANDLE add_contact(char *name, DWORD flags) { }
void logoff_contacts(BOOL bCleanup) {
- HANDLE hContact;
+ HCONTACT hContact;
char *szProto;
DBVARIANT dbv={0};
diff --git a/protocols/SkypeClassic/src/contacts.h b/protocols/SkypeClassic/src/contacts.h index 35a400c3e9..1cc71571a5 100644 --- a/protocols/SkypeClassic/src/contacts.h +++ b/protocols/SkypeClassic/src/contacts.h @@ -1,11 +1,14 @@ // Prototypes
-HANDLE add_contextmenu(HANDLE hContact);
-HANDLE find_contact(char *name);
-HANDLE find_contactT(TCHAR *name);
-HANDLE add_contact(char *name, DWORD flags);
+HANDLE add_contextmenu(HCONTACT hContact);
HANDLE add_mainmenu(void);
+
+HCONTACT find_contact(char *name);
+HCONTACT find_contactT(TCHAR *name);
+HCONTACT add_contact(char *name, DWORD flags);
+
CLISTMENUITEM HupItem(void);
CLISTMENUITEM CallItem(void);
+
void logoff_contacts(BOOL bCleanup);
int PrebuildContactMenu(WPARAM, LPARAM);
//int ClistDblClick(WPARAM, LPARAM);
\ No newline at end of file diff --git a/protocols/SkypeClassic/src/gchat.cpp b/protocols/SkypeClassic/src/gchat.cpp index 0a1ea0441b..dd38a9d990 100644 --- a/protocols/SkypeClassic/src/gchat.cpp +++ b/protocols/SkypeClassic/src/gchat.cpp @@ -112,7 +112,7 @@ gchat_contact *GetChatContact(gchat_contacts *gc, const TCHAR *who) { static int AddChatContact(gchat_contacts *gc, char *who, TCHAR *pszRole)
{
int i = -2;
- HANDLE hContact;
+ HCONTACT hContact;
CONTACTINFO ci = {0};
TCHAR *twho;
@@ -165,10 +165,10 @@ void RemChatContact(gchat_contacts *gc, const TCHAR *who) { }
}
-HANDLE find_chat(LPCTSTR chatname) {
+HCONTACT find_chat(LPCTSTR chatname) {
char *szProto;
int tCompareResult;
- HANDLE hContact;
+ HCONTACT hContact;
DBVARIANT dbv;
for (hContact=db_find_first();hContact != NULL;hContact=db_find_next(hContact)) {
@@ -187,10 +187,10 @@ HANDLE find_chat(LPCTSTR chatname) { }
#ifdef _UNICODE
-HANDLE find_chatA(char *chatname) {
+HCONTACT find_chatA(char *chatname) {
char *szProto;
int tCompareResult;
- HANDLE hContact;
+ HCONTACT hContact;
DBVARIANT dbv;
for (hContact=db_find_first();hContact != NULL;hContact=db_find_next(hContact)) {
@@ -479,7 +479,7 @@ void KillChatSession(GCDEST *gcd) void InviteUser(const TCHAR *szChatId)
{
HMENU tMenu = CreatePopupMenu();
- HANDLE hContact = db_find_first(), hInvitedUser;
+ HCONTACT hContact = db_find_first(), hInvitedUser;
DBVARIANT dbv;
HWND tWindow;
POINT pt;
@@ -516,7 +516,7 @@ void InviteUser(const TCHAR *szChatId) tWindow = CreateWindow(_T("EDIT"),_T(""),0,1,1,1,1,NULL,NULL,hInst,NULL);
GetCursorPos (&pt);
- hInvitedUser = (HANDLE)TrackPopupMenu(tMenu, TPM_NONOTIFY | TPM_LEFTALIGN | TPM_TOPALIGN | TPM_RETURNCMD, pt.x, pt.y, 0, tWindow, NULL);
+ hInvitedUser = (HCONTACT)TrackPopupMenu(tMenu, TPM_NONOTIFY | TPM_LEFTALIGN | TPM_TOPALIGN | TPM_RETURNCMD, pt.x, pt.y, 0, tWindow, NULL);
DestroyMenu(tMenu);
DestroyWindow(tWindow);
@@ -527,7 +527,7 @@ void InviteUser(const TCHAR *szChatId) }
-static void KickUser (HANDLE hContact, GCHOOK *gch)
+static void KickUser (HCONTACT hContact, GCHOOK *gch)
{
char *ptr;
@@ -566,7 +566,7 @@ static void KickUser (HANDLE hContact, GCHOOK *gch) void SetChatTopic(const TCHAR *szChatId, TCHAR *szTopic, BOOL bSet)
{
- HANDLE hContact = find_chat (szChatId);
+ HCONTACT hContact = find_chat (szChatId);
char *szUTFTopic;
GCDEST gcd = { SKYPE_PROTONAME, szChatId, GC_EVENT_TOPIC };
@@ -608,7 +608,7 @@ int GCEventHook(WPARAM wParam,LPARAM lParam) { switch (gch->pDest->iType) {
case GC_SESSION_TERMINATE: {
- HANDLE hContact;
+ HCONTACT hContact;
if (gc->mJoinedCount == 1) {
// switch back to normal session
@@ -691,7 +691,7 @@ int GCEventHook(WPARAM wParam,LPARAM lParam) { InviteUser(gch->pDest->ptszID);
break;
case GC_USER_PRIVMESS: {
- HANDLE hContact = find_contactT(gch->ptszUID);
+ HCONTACT hContact = find_contactT(gch->ptszUID);
if (hContact) CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0);
break;
@@ -714,7 +714,7 @@ int GCEventHook(WPARAM wParam,LPARAM lParam) { }
break;
case GC_USER_NICKLISTMENU: {
- HANDLE hContact = find_contactT(gch->ptszUID);
+ HCONTACT hContact = find_contactT(gch->ptszUID);
switch(gch->dwData) {
case 10:CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0); break;
@@ -821,7 +821,7 @@ int __cdecl GCMenuHook(WPARAM wParam,LPARAM lParam) { INT_PTR GCOnLeaveChat(WPARAM wParam,LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
DBVARIANT dbv;
UNREFERENCED_PARAMETER(lParam);
@@ -837,7 +837,7 @@ INT_PTR GCOnLeaveChat(WPARAM wParam,LPARAM lParam) INT_PTR GCOnJoinChat(WPARAM wParam,LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
DBVARIANT dbv;
UNREFERENCED_PARAMETER(lParam);
diff --git a/protocols/SkypeClassic/src/gchat.h b/protocols/SkypeClassic/src/gchat.h index 1b3cfcbe73..13ef26afe6 100644 --- a/protocols/SkypeClassic/src/gchat.h +++ b/protocols/SkypeClassic/src/gchat.h @@ -12,7 +12,7 @@ #define MAX_BUF 256 // Buffer for topic-string
typedef struct {
- HANDLE hContact;
+ HCONTACT hContact;
TCHAR who[33];
TCHAR szRole[12];
} gchat_contact;
@@ -26,9 +26,9 @@ typedef struct { int ChatInit(WPARAM, LPARAM);
int __cdecl ChatStart(char *szChatId, BOOL bJustCreate);
gchat_contacts *GetChat(LPCTSTR szChatId);
-HANDLE find_chat(LPCTSTR chatname);
+HCONTACT find_chat(LPCTSTR chatname);
#ifdef _UNICODE
-HANDLE find_chatA(char *chatname);
+HCONTACT find_chatA(char *chatname);
#else
#define find_chatA find_chat
#endif
diff --git a/protocols/SkypeClassic/src/skype.cpp b/protocols/SkypeClassic/src/skype.cpp index 20a75aaea5..49e0c528b7 100644 --- a/protocols/SkypeClassic/src/skype.cpp +++ b/protocols/SkypeClassic/src/skype.cpp @@ -123,7 +123,7 @@ typedef struct { } fetchmsg_arg;
typedef struct {
- HANDLE hContact;
+ HCONTACT hContact;
char szId[16];
} msgsendwt_arg;
@@ -266,7 +266,7 @@ int HookContactAdded(WPARAM wParam, LPARAM lParam) { szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, wParam, 0 );
if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME))
- add_contextmenu((HANDLE)wParam);
+ add_contextmenu((HCONTACT)wParam);
return 0;
}
@@ -280,7 +280,7 @@ int HookContactDeleted(WPARAM wParam, LPARAM lParam) { DBVARIANT dbv;
int retval;
- if (db_get_s((HANDLE)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return 1;
+ if (db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return 1;
retval=SkypeSend("SET USER %s BUDDYSTATUS 1", dbv.pszVal);
db_free(&dbv);
if (retval) return 1;
@@ -288,7 +288,8 @@ int HookContactDeleted(WPARAM wParam, LPARAM lParam) { return 0;
}
-void GetInfoThread(HANDLE hContact) {
+void GetInfoThread(void *hContact)
+{
DBVARIANT dbv;
int i;
char *ptr;
@@ -301,10 +302,9 @@ void GetInfoThread(HANDLE hContact) { char *pszProps[] = {
"BIRTHDAY", "COUNTRY", "SEX", "MOOD_TEXT", "TIMEZONE", "IS_VIDEO_CAPABLE"};
-
LOG (("GetInfoThread started."));
EnterCriticalSection (&QueryThreadMutex);
- if (db_get_s(hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv))
+ if (db_get_s((HCONTACT)hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv))
{
LOG (("GetInfoThread terminated, cannot find Skype Name for contact %08X.", hContact));
LeaveCriticalSection (&QueryThreadMutex);
@@ -320,7 +320,7 @@ void GetInfoThread(HANDLE hContact) { if (ptr=SkypeGet ("USER", dbv.pszVal, "FULLNAME")) {
if (*ptr && !bSetNick && db_get_b(NULL, SKYPE_PROTONAME, "ShowFullname", 1)) {
// No Displayname and FULLNAME requested
- db_set_utf(hContact, SKYPE_PROTONAME, "Nick", ptr);
+ db_set_utf((HCONTACT)hContact, SKYPE_PROTONAME, "Nick", ptr);
bSetNick = TRUE;
}
free (ptr);
@@ -328,7 +328,7 @@ void GetInfoThread(HANDLE hContact) { if (!bSetNick) {
// Still no nick set, so use SKYPE Nickname
- db_set_s(hContact, SKYPE_PROTONAME, "Nick", dbv.pszVal);
+ db_set_s((HCONTACT)hContact, SKYPE_PROTONAME, "Nick", dbv.pszVal);
}
@@ -345,7 +345,7 @@ void GetInfoThread(HANDLE hContact) { ACKDATA ack = {0};
ack.cbSize = sizeof( ACKDATA );
ack.szModule = SKYPE_PROTONAME;
- ack.hContact = hContact;
+ ack.hContact = (HCONTACT)hContact;
ack.type = ACKTYPE_AVATAR;
ack.result = ACKRESULT_STATUS;
@@ -359,13 +359,14 @@ void GetInfoThread(HANDLE hContact) { if (ptr=SkypeGet ("USER", dbv.pszVal, m_settings[i].SkypeSetting)) free (ptr);
}
- ProtoBroadcastAck(SKYPE_PROTONAME, hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
+ ProtoBroadcastAck(SKYPE_PROTONAME, (HCONTACT)hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
LeaveCriticalSection(&QueryThreadMutex);
db_free(&dbv);
LOG (("GetInfoThread terminated gracefully."));
}
-time_t SkypeTime(time_t *timer) {
+time_t SkypeTime(time_t *timer)
+{
struct _timeb tb;
EnterCriticalSection (&TimeMutex);
@@ -448,11 +449,11 @@ INT_PTR ImportHistory(WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam);
- if (db_get_b((HANDLE)wParam, SKYPE_PROTONAME, "ChatRoom", 0)) {
- if (db_get_s((HANDLE)wParam, SKYPE_PROTONAME, "ChatRoomID", &dbv)) return 0;
+ if (db_get_b((HCONTACT)wParam, SKYPE_PROTONAME, "ChatRoom", 0)) {
+ if (db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, "ChatRoomID", &dbv)) return 0;
SkypeSend ("GET CHAT %s CHATMESSAGES", dbv.pszVal);
} else {
- if (db_get_s((HANDLE)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return 0;
+ if (db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return 0;
SkypeSend("SEARCH %sS %s", cmdMessage, dbv.pszVal);
}
db_free(&dbv);
@@ -500,7 +501,7 @@ void __cdecl SearchUsersWaitingMyAuthorization(void *dummy) { while (token) {
CCSDATA ccs={0};
PROTORECVEVENT pre={0};
- HANDLE hContact;
+ HCONTACT hContact;
char *firstname=NULL, *lastname=NULL, *pCurBlob;
LOG(("Awaiting auth: %s", token));
@@ -512,7 +513,7 @@ void __cdecl SearchUsersWaitingMyAuthorization(void *dummy) { pre.timestamp=(DWORD)SkypeTime(NULL);
/* blob is: */
- //DWORD protocolSpecific HANDLE hContact
+ //DWORD protocolSpecific HCONTACT hContact
//ASCIIZ nick, firstName, lastName, e-mail, requestReason
if (firstname=SkypeGet("USER", token, "FULLNAME"))
if (lastname=strchr(firstname, ' ')) {
@@ -869,9 +870,10 @@ void FetchMessageThread(fetchmsg_arg *pargs) { char *ptr, *msgptr, szPartnerHandle[32], szBuf[128];
int direction=0, msglen = 0;
DWORD timestamp = 0, lwr=0;
- CCSDATA ccs={0};
- PROTORECVEVENT pre={0};
- HANDLE hContact = NULL, hDbEvent, hChat = NULL;
+ CCSDATA ccs={0};
+ PROTORECVEVENT pre={0};
+ HCONTACT hContact = NULL, hChat = NULL;
+ HANDLE hDbEvent;
DBEVENTINFO dbei={0};
DBVARIANT dbv={0};
fetchmsg_arg args;
@@ -1033,7 +1035,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) { free_nonutf_tchar_string((void*)gcd.ptszID);
if (!args.bDontMarkSeen)
{
- MsgList_Add (pre.lParam, INVALID_HANDLE_VALUE);
+ MsgList_Add(pre.lParam, INVALID_HANDLE_VALUE);
SkypeSend("SET %s %s SEEN", cmdMessage, args.msgnum);
}
__leave;
@@ -1271,7 +1273,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) { // Check if the timestamp is valid
dbei.cbSize=sizeof(dbei);
dbei.cbBlob=0;
- if (hDbEvent=db_event_first(hContact)) {
+ if (hDbEvent = db_event_first(hContact)) {
db_event_get(hDbEvent,&dbei);
lwr=dbei.timestamp;
}
@@ -1306,7 +1308,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) { if (db_get_b(hContact, "MetaContacts", "IsSubcontact", 0))
{
DWORD dwMetaLink = db_get_dw(hContact, "MetaContacts", "MetaLink", MAXDWORD);
- HANDLE hMetaContact;
+ HCONTACT hMetaContact;
if (dwMetaLink != MAXDWORD && (hMetaContact = GetMetaHandle(dwMetaLink)))
{
@@ -1361,8 +1363,8 @@ void FetchMessageThreadSync(fetchmsg_arg *pargs) { /*
if (pargs->bIsRead && pMsgEvent->hEvent != INVALID_HANDLE_VALUE)
{
- HANDLE hContact;
- if ((int)(hContact = (HANDLE)CallService (MS_DB_EVENT_GETCONTACT, (WPARAM)pMsgEntry->hEvent, 0)) != -1)
+ HCONTACT hContact;
+ if ((int)(hContact = (HCONTACT)CallService (MS_DB_EVENT_GETCONTACT, (WPARAM)pMsgEntry->hEvent, 0)) != -1)
CallService (MS_DB_EVENT_MARKREAD, (WPARAM)hContact, (LPARAM)hDBEvent);
}
*/
@@ -1416,9 +1418,10 @@ char *GetCallerHandle(char *szSkypeMsg) { }
-HANDLE GetCallerContact(char *szSkypeMsg) {
+HCONTACT GetCallerContact(char *szSkypeMsg)
+{
char *szHandle;
- HANDLE hContact=NULL;
+ HCONTACT hContact=NULL;
if (!(szHandle=GetCallerHandle(szSkypeMsg))) return NULL;
if (!(hContact=find_contact(szHandle))) {
@@ -1438,17 +1441,15 @@ HANDLE GetCallerContact(char *szSkypeMsg) { return hContact;
}
-HANDLE GetMetaHandle(DWORD dwId) {
- HANDLE hContact;
- char *szProto;
-
- for (hContact=db_find_first();hContact != NULL;hContact=db_find_next(hContact)) {
- szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0 );
+HCONTACT GetMetaHandle(DWORD dwId)
+{
+ for (HCONTACT hContact=db_find_first(); hContact != NULL; hContact=db_find_next(hContact)) {
+ char *szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0 );
if (szProto!=NULL && !strcmp(szProto, "MetaContacts") &&
db_get_dw(hContact, "MetaContacts", "MetaID", MAXDWORD)==dwId)
- return hContact;
- }
- return 0;
+ return hContact;
+ }
+ return 0;
}
LRESULT CALLBACK InCallPopUpProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
@@ -1476,7 +1477,7 @@ LRESULT CALLBACK InCallPopUpProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam) }
void RingThread(char *szSkypeMsg) {
- HANDLE hContact;
+ HCONTACT hContact;
DBEVENTINFO dbei={0};
DBVARIANT dbv;
char *ptr = NULL;
@@ -1604,7 +1605,8 @@ l_exitRT: }
void EndCallThread(char *szSkypeMsg) {
- HANDLE hContact=NULL, hDbEvent;
+ HCONTACT hContact=NULL;
+ HANDLE hDbEvent;
DBEVENTINFO dbei={0};
DBVARIANT dbv;
int tCompareResult;
@@ -1640,7 +1642,7 @@ void EndCallThread(char *szSkypeMsg) { if (!HasVoiceService()) {
dbei.cbSize=sizeof(dbei);
- hDbEvent=db_event_firstUnread(hContact);
+ hDbEvent = db_event_firstUnread(hContact);
while(hDbEvent) {
dbei.cbBlob=0;
db_event_get(hDbEvent, &dbei);
@@ -1666,7 +1668,7 @@ void EndCallThread(char *szSkypeMsg) { }
void HoldCallThread(char *szSkypeMsg) {
- HANDLE hContact;
+ HCONTACT hContact;
LOG(("HoldCallThread started"));
if (!szSkypeMsg) {
@@ -1682,7 +1684,7 @@ void HoldCallThread(char *szSkypeMsg) { }
void ResumeCallThread(char *szSkypeMsg) {
- HANDLE hContact;
+ HCONTACT hContact;
LOG(("ResumeCallThread started"));
if (!szSkypeMsg) {
@@ -1740,7 +1742,7 @@ LONG APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) static char *onlinestatus=NULL;
static BOOL RestoreUserStatus=FALSE;
int sstat, oldstatus, flag;
- HANDLE hContact;
+ HCONTACT hContact;
fetchmsg_arg *args;
static int iReentranceCnt = 0;
@@ -2088,7 +2090,7 @@ LONG APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) } else
if (strncmp(ptr, " FRIENDLYNAME ", 14) == 0) {
// Chat session name
- HANDLE hContact;
+ HCONTACT hContact;
*ptr=0;
if (hContact = find_chatA(szSkypeMsg+5))
@@ -2356,7 +2358,7 @@ INT_PTR SkypeSetStatus(WPARAM wParam, LPARAM lParam) return iRet;
}
-int __stdcall SendBroadcast( HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam )
+int __stdcall SendBroadcast( HCONTACT hContact, int type, int result, HANDLE hProcess, LPARAM lParam )
{
ACKDATA ack = {0};
ack.cbSize = sizeof( ACKDATA );
@@ -2369,14 +2371,14 @@ int __stdcall SendBroadcast( HANDLE hContact, int type, int result, HANDLE hProc return CallService( MS_PROTO_BROADCASTACK, 0, ( LPARAM )&ack );
}
-static void __cdecl SkypeGetAwayMessageThread( HANDLE hContact )
+static void __cdecl SkypeGetAwayMessageThread(void *hContact)
{
DBVARIANT dbv;
- if ( !db_get_ts( hContact, "CList", "StatusMsg", &dbv )) {
- SendBroadcast( hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, ( HANDLE )1, ( LPARAM )dbv.ptszVal );
+ if (!db_get_ts((HCONTACT)hContact, "CList", "StatusMsg", &dbv )) {
+ SendBroadcast((HCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, ( HANDLE )1, ( LPARAM )dbv.ptszVal );
db_free( &dbv );
}
- else SendBroadcast( hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, ( HANDLE )1, ( LPARAM )0 );
+ else SendBroadcast((HCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, ( HANDLE )1, ( LPARAM )0 );
}
INT_PTR SkypeGetAwayMessage(WPARAM wParam,LPARAM lParam)
@@ -2385,7 +2387,7 @@ INT_PTR SkypeGetAwayMessage(WPARAM wParam,LPARAM lParam) UNREFERENCED_PARAMETER(wParam);
- pthread_create( SkypeGetAwayMessageThread, ccs->hContact );
+ pthread_create(SkypeGetAwayMessageThread, ccs->hContact);
return 1;
}
@@ -2447,7 +2449,8 @@ static int _GetFileSize(char* filename) */
void RetrieveUserAvatar(void *param)
{
- HANDLE hContact = (HANDLE) param, file;
+ HCONTACT hContact = (HCONTACT) param;
+ HANDLE file;
PROTO_AVATAR_INFORMATION AI={0};
ACKDATA ack = {0};
DBVARIANT dbv;
@@ -2774,7 +2777,7 @@ INT_PTR SkypeRecvMessage(WPARAM wParam, LPARAM lParam) INT_PTR SkypeUserIsTyping(WPARAM wParam, LPARAM lParam) {
DBVARIANT dbv={0};
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (protocol<5 && !bIsImoproxy) return 0;
if (db_get_s(hContact, SKYPE_PROTONAME, "Typing_Stream", &dbv)) {
@@ -2890,7 +2893,7 @@ INT_PTR SkypeAddToListByEvent(WPARAM wParam, LPARAM lParam) { if (pBlob=__skypeauth(wParam))
{
- HANDLE hContact=add_contact(pBlob+sizeof(DWORD)+sizeof(HANDLE), LOWORD(wParam));
+ HCONTACT hContact=add_contact(pBlob+sizeof(DWORD)+sizeof(HANDLE), LOWORD(wParam));
free(pBlob);
if (hContact) return (int)hContact;
}
@@ -2911,7 +2914,7 @@ INT_PTR SkypeRegisterProxy(WPARAM wParam, LPARAM lParam) { void CleanupNicknames(char *dummy) {
- HANDLE hContact;
+ HCONTACT hContact;
char *szProto;
DBVARIANT dbv, dbv2;
@@ -3011,7 +3014,7 @@ int EnumOldPluginName(const char *szSetting,LPARAM lParam) // 0 --> No
int AnySkypeusers(void)
{
- HANDLE hContact;
+ HCONTACT hContact;
DBVARIANT dbv;
int tCompareResult;
@@ -3036,7 +3039,7 @@ int AnySkypeusers(void) DBCONTACTENUMSETTINGS cns;
DBCONTACTWRITESETTING cws;
DBVARIANT dbv;
- HANDLE hContact=NULL;
+ HCONTACT hContact=NULL;
struct PLUGINDI pdi;
LOG(("Updating old database settings if there are any..."));
diff --git a/protocols/SkypeClassic/src/skype.h b/protocols/SkypeClassic/src/skype.h index 3c7fd2b927..83021b91c6 100644 --- a/protocols/SkypeClassic/src/skype.h +++ b/protocols/SkypeClassic/src/skype.h @@ -140,7 +140,7 @@ int ShowMessageA(int iconID, char *lpzText, int mustShow); #define ShowMessageA ShowMessage
#endif
void EndCallThread(char *);
-void GetInfoThread(HANDLE);
+void GetInfoThread(void *);
int OnDetailsInit( WPARAM, LPARAM );
INT_PTR SkypeGetAvatarInfo(WPARAM wParam,LPARAM lParam);
INT_PTR SkypeGetAvatarCaps(WPARAM wParam,LPARAM lParam);
@@ -172,7 +172,7 @@ int __stdcall EnterBitmapFileName( char* szDest ); void CleanupNicknames(char *dummy);
int InitVSApi();
int FreeVSApi();
-HANDLE GetMetaHandle(DWORD dwId);
+HCONTACT GetMetaHandle(DWORD dwId);
void LaunchSkypeAndSetStatusThread(void *newStatus);
// Structs
diff --git a/protocols/SkypeClassic/src/skypeapi.cpp b/protocols/SkypeClassic/src/skypeapi.cpp index c7d8ab8010..84e886b61a 100644 --- a/protocols/SkypeClassic/src/skypeapi.cpp +++ b/protocols/SkypeClassic/src/skypeapi.cpp @@ -413,7 +413,7 @@ char *SkypeRcv(char *what, DWORD maxwait) return SkypeRcvTime(what, 0, maxwait);
}
-char *SkypeRcvMsg(char *what, time_t st, HANDLE hContact, DWORD maxwait)
+char *SkypeRcvMsg(char *what, time_t st, HCONTACT hContact, DWORD maxwait)
{
char *msg, msgid[32]={0}, *pMsg, *pCurMsg;
struct MsgQueue *ptr;
@@ -612,10 +612,10 @@ INT_PTR SkypeCall(WPARAM wParam, LPARAM lParam) { char *msg=0;
int res;
- if (!db_get_s((HANDLE)wParam, SKYPE_PROTONAME, "CallId", &dbv)) {
+ if (!db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv)) {
res = -1; // no direct return, because dbv needs to be freed
} else {
- if (db_get_s((HANDLE)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return -1;
+ if (db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return -1;
msg=(char *)malloc(strlen(dbv.pszVal)+6);
strcpy(msg, "CALL ");
strcat(msg, dbv.pszVal);
@@ -644,13 +644,13 @@ INT_PTR SkypeCallHangup(WPARAM wParam, LPARAM lParam) char *msg=0;
int res = -1;
- if (!db_get_s((HANDLE)wParam, SKYPE_PROTONAME, "CallId", &dbv)) {
+ if (!db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv)) {
msg=(char *)malloc(strlen(dbv.pszVal)+21);
sprintf(msg, "SET %s STATUS FINISHED", dbv.pszVal);
//sprintf(msg, "ALTER CALL %s HANGUP", dbv.pszVal);
res=SkypeSend(msg);
#if _DEBUG
- db_unset((HANDLE)wParam, SKYPE_PROTONAME, "CallId");
+ db_unset((HCONTACT)wParam, SKYPE_PROTONAME, "CallId");
#endif
//} else {
// if (db_get((HANDLE)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return -1;
@@ -686,14 +686,14 @@ static void FixNumber(char *p) { * Purpose: Dialog procedure for the Dial-Dialog
*/
static INT_PTR CALLBACK DialDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) {
- static HANDLE hContact;
+ static HCONTACT hContact;
static unsigned int entries=0;
BOOL TempAdded=FALSE;
char number[64], *msg, *ptr=NULL;
switch (uMsg){
case WM_INITDIALOG:
- hContact=(HANDLE)lParam;
+ hContact=(HCONTACT)lParam;
Utils_RestoreWindowPosition(hwndDlg, NULL, SKYPE_PROTONAME, "DIALdlg");
TranslateDialogDefault(hwndDlg);
@@ -810,10 +810,10 @@ static INT_PTR CALLBACK CallstatDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, switch (uMsg){
case WM_INITDIALOG:
{
- HANDLE hContact;
+ HCONTACT hContact;
char *szProto;
- if (!db_get_s((HANDLE)lParam, SKYPE_PROTONAME, "CallId", &dbv)) {
+ if (!db_get_s((HCONTACT)lParam, SKYPE_PROTONAME, "CallId", &dbv)) {
// Check, if another call is in progress
for (hContact=db_find_first();hContact != NULL;hContact=db_find_next(hContact)) {
@@ -928,7 +928,7 @@ INT_PTR SkypeOutCall(WPARAM wParam, LPARAM lParam) { DBVARIANT dbv;
int res = -1;
- if (wParam && !db_get_s((HANDLE)wParam, SKYPE_PROTONAME, "CallId", &dbv)) {
+ if (wParam && !db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv)) {
res=SkypeSend("SET %s STATUS FINISHED", dbv.pszVal);
pthread_create(( pThreadFunc )SkypeOutCallErrorCheck, _strdup(dbv.pszVal));
db_free(&dbv);
@@ -948,10 +948,10 @@ INT_PTR SkypeHoldCall(WPARAM wParam, LPARAM lParam) { int retval;
LOG(("SkypeHoldCall started"));
- if (!wParam || db_get_s((HANDLE)wParam, SKYPE_PROTONAME, "CallId", &dbv))
+ if (!wParam || db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv))
return -1;
retval = SkypeSend ("SET %s STATUS %s", dbv.pszVal,
- db_get_b((HANDLE)wParam, SKYPE_PROTONAME, "OnHold", 0)?"INPROGRESS":"ONHOLD");
+ db_get_b((HCONTACT)wParam, SKYPE_PROTONAME, "OnHold", 0)?"INPROGRESS":"ONHOLD");
db_free(&dbv);
return retval;
}
@@ -1146,7 +1146,7 @@ INT_PTR SkypeSendFile(WPARAM wParam, LPARAM lParam) { DBVARIANT dbv;
int retval;
- if (!wParam || db_get_s((HANDLE)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv))
+ if (!wParam || db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv))
return -1;
retval=SkypeSend("OPEN FILETRANSFER %s", dbv.pszVal);
db_free(&dbv);
@@ -1163,7 +1163,7 @@ INT_PTR SkypeSendFile(WPARAM wParam, LPARAM lParam) { */
INT_PTR SkypeChatCreate(WPARAM wParam, LPARAM lParam) {
DBVARIANT dbv;
- HANDLE hContact=(HANDLE)wParam;
+ HCONTACT hContact=(HCONTACT)wParam;
char *ptr, *ptr2;
if (!hContact || db_get_s(hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv))
diff --git a/protocols/SkypeClassic/src/skypeapi.h b/protocols/SkypeClassic/src/skypeapi.h index fa4f5139a1..0d3f661dcb 100644 --- a/protocols/SkypeClassic/src/skypeapi.h +++ b/protocols/SkypeClassic/src/skypeapi.h @@ -28,7 +28,7 @@ char *SkypeMsgGet(void); int SkypeSend(char*, ...);
char *SkypeRcv(char *what, DWORD maxwait);
char *SkypeRcvTime(char *what, time_t st, DWORD maxwait);
-char *SkypeRcvMsg(char *what, time_t st, HANDLE hContact, DWORD maxwait);
+char *SkypeRcvMsg(char *what, time_t st, HCONTACT hContact, DWORD maxwait);
INT_PTR SkypeCall(WPARAM wParam, LPARAM lParam);
INT_PTR SkypeCallHangup(WPARAM wParam, LPARAM lParam);
INT_PTR SkypeOutCall(WPARAM wParam, LPARAM lParam);
diff --git a/protocols/SkypeClassic/src/skypeopt.cpp b/protocols/SkypeClassic/src/skypeopt.cpp index 75b90967f2..8b90c78780 100644 --- a/protocols/SkypeClassic/src/skypeopt.cpp +++ b/protocols/SkypeClassic/src/skypeopt.cpp @@ -159,7 +159,7 @@ INT_PTR CALLBACK OptPopupDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar {
case IDC_PREVIEW:
{
- HANDLE hContact;
+ HCONTACT hContact;
TCHAR * lpzContactName;
hContact = db_find_first();
@@ -750,7 +750,7 @@ INT_PTR CALLBACK OptionsDefaultDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L int OnDetailsInit( WPARAM wParam, LPARAM lParam )
{
OPTIONSDIALOGPAGE odp = {0};
- HANDLE hContact = ( HANDLE )lParam;
+ HCONTACT hContact = (HCONTACT)lParam;
odp.cbSize = sizeof(odp);
odp.hIcon = NULL;
diff --git a/protocols/SkypeClassic/src/voiceservice.cpp b/protocols/SkypeClassic/src/voiceservice.cpp index 2a22bbe86c..11b1f1becd 100644 --- a/protocols/SkypeClassic/src/voiceservice.cpp +++ b/protocols/SkypeClassic/src/voiceservice.cpp @@ -20,7 +20,7 @@ BOOL HasVoiceService() return has_voice_service;
}
-void NofifyVoiceService(HANDLE hContact, char *callId, int state)
+void NofifyVoiceService(HCONTACT hContact, char *callId, int state)
{
VOICE_CALL vc = {0};
vc.cbSize = sizeof(vc);
@@ -42,7 +42,7 @@ static INT_PTR VoiceGetInfo(WPARAM wParam, LPARAM lParam) static HANDLE FindContactByCallId(char *callId)
{
- HANDLE hContact;
+ HCONTACT hContact;
int iCmpRes;
for (hContact = db_find_first();
hContact != NULL;
@@ -73,7 +73,7 @@ static INT_PTR VoiceCall(WPARAM wParam, LPARAM lParam) if (!wParam) return -1;
- if (db_get_s((HANDLE)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv))
+ if (db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv))
return -1;
SkypeSend("CALL %s", dbv.pszVal);
diff --git a/protocols/SkypeClassic/src/voiceservice.h b/protocols/SkypeClassic/src/voiceservice.h index 0ffbd6d9ca..fce03545d2 100644 --- a/protocols/SkypeClassic/src/voiceservice.h +++ b/protocols/SkypeClassic/src/voiceservice.h @@ -10,7 +10,7 @@ BOOL HasVoiceService(); void VoiceServiceInit();
void VoiceServiceExit();
void VoiceServiceModulesLoaded();
-void NofifyVoiceService(HANDLE hContact, char *callId, int state) ;
+void NofifyVoiceService(HCONTACT hContact, char *callId, int state) ;
|