From 159b565b390687258ee65a3b66596e118752063c Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Fri, 22 May 2015 12:33:13 +0000 Subject: replace strcmp to mir_strcmp git-svn-id: http://svn.miranda-ng.org/main/trunk@13752 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeClassic/src/contacts.cpp | 8 +- protocols/SkypeClassic/src/filexfer.cpp | 16 ++-- protocols/SkypeClassic/src/gchat.cpp | 6 +- protocols/SkypeClassic/src/skype.cpp | 102 ++++++++++----------- protocols/SkypeClassic/src/skypeapi.cpp | 18 ++-- protocols/SkypeClassic/src/skypeproxy/skypeproxy.c | 8 +- 6 files changed, 79 insertions(+), 79 deletions(-) (limited to 'protocols/SkypeClassic') diff --git a/protocols/SkypeClassic/src/contacts.cpp b/protocols/SkypeClassic/src/contacts.cpp index f07139775d..ed10c5d43a 100644 --- a/protocols/SkypeClassic/src/contacts.cpp +++ b/protocols/SkypeClassic/src/contacts.cpp @@ -223,7 +223,7 @@ int __cdecl PrebuildContactMenu(WPARAM wParam, LPARAM) { DBVARIANT dbv; BOOL callAvailable = FALSE; BOOL hangupAvailable = FALSE; - if (!strcmp(szProto, SKYPE_PROTONAME)) { + if (!mir_strcmp(szProto, SKYPE_PROTONAME)) { if (!db_get(hContact, SKYPE_PROTONAME, "CallId", &dbv)) { if (db_get_b(hContact, SKYPE_PROTONAME, "OnHold", 0)) mi = ResumeCallItem(); else mi = HoldCallItem(); @@ -306,7 +306,7 @@ int ClistDblClick(WPARAM wParam, LPARAM lParam) { char *szProto; szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, wParam, 0 ); -if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME) && +if (szProto!=NULL && !mir_strcmp(szProto, SKYPE_PROTONAME) && db_get_w((HANDLE)wParam, SKYPE_PROTONAME, "Status", ID_STATUS_OFFLINE)==ID_STATUS_ONTHEPHONE) { SkypeCall(wParam, 0); } @@ -326,7 +326,7 @@ MCONTACT find_contact(char *name) if (db_get_b(hContact, SKYPE_PROTONAME, "ChatRoom", 0) == 0) { if (db_get_s(hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) continue; - tCompareResult = strcmp(dbv.pszVal, name); + tCompareResult = mir_strcmp(dbv.pszVal, name); db_free(&dbv); if (tCompareResult) continue; return hContact; // already there, return handle @@ -402,7 +402,7 @@ void logoff_contacts(BOOL bCleanup) { LOG(("logoff_contacts: Logging off contacts.")); for (hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) { szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0); - if (szProto != NULL && !strcmp(szProto, SKYPE_PROTONAME)) + if (szProto != NULL && !mir_strcmp(szProto, SKYPE_PROTONAME)) { if (db_get_w(hContact, SKYPE_PROTONAME, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) db_set_w(hContact, SKYPE_PROTONAME, "Status", ID_STATUS_OFFLINE); diff --git a/protocols/SkypeClassic/src/filexfer.cpp b/protocols/SkypeClassic/src/filexfer.cpp index af8af1c1cc..f24e7273a7 100644 --- a/protocols/SkypeClassic/src/filexfer.cpp +++ b/protocols/SkypeClassic/src/filexfer.cpp @@ -215,10 +215,10 @@ BOOL FXHandleRecv(PROTORECVEVENT *pre, MCONTACT hContact) for (char *pszMsgNum = strtok(pszXferIDs, ", "); pszMsgNum; pszMsgNum = strtok(NULL, ", ")) { char *pszStatus = SkypeGetErrID("FILETRANSFER", pszMsgNum, "STATUS"); if (pszStatus) { - if (!strcmp(pszStatus, "NEW") || !strcmp(pszStatus, "PLACEHOLDER")) { + if (!mir_strcmp(pszStatus, "NEW") || !mir_strcmp(pszStatus, "PLACEHOLDER")) { char *pszType = SkypeGetErr("FILETRANSFER", pszMsgNum, "TYPE"); if (pszType) { - if (!strcmp(pszType, "INCOMING")) { + if (!mir_strcmp(pszType, "INCOMING")) { char *pszFN = SkypeGetErr("FILETRANSFER", pszMsgNum, "FILENAME"); if (pszFN) { cbNewSize = cbMsg + mir_strlen(pszFN) + 2; @@ -284,15 +284,15 @@ void FXHandleMessageThread(ft_args *pargs) } if (pargs->bStatus) { - if (!strcmp(pargs->szArg, "CONNECTING")) + if (!mir_strcmp(pargs->szArg, "CONNECTING")) ProtoBroadcastAck(SKYPE_PROTONAME, hContact, ACKTYPE_FILE, ACKRESULT_CONNECTING, (HANDLE)dwChat, 0); else if (!strncmp(pargs->szArg, "TRANSFERRING", 12)) ProtoBroadcastAck(SKYPE_PROTONAME, hContact, ACKTYPE_FILE, ACKRESULT_CONNECTED, (HANDLE)dwChat, 0); - else if (!strcmp(pargs->szArg, "FAILED")) + else if (!mir_strcmp(pargs->szArg, "FAILED")) ProtoBroadcastAck(SKYPE_PROTONAME, hContact, ACKTYPE_FILE, ACKRESULT_FAILED, (HANDLE)dwChat, 0); - else if (!strcmp(pargs->szArg, "CANCELLED")) + else if (!mir_strcmp(pargs->szArg, "CANCELLED")) ProtoBroadcastAck(SKYPE_PROTONAME, hContact, ACKTYPE_FILE, ACKRESULT_DENIED, (HANDLE)dwChat, 0); - else if (!strcmp(pargs->szArg, "COMPLETED")) { + else if (!mir_strcmp(pargs->szArg, "COMPLETED")) { // Check if all transfers from this message are completed. char *pszMsgNum, *pszStatus; BOOL bAllComplete = TRUE; @@ -300,7 +300,7 @@ void FXHandleMessageThread(ft_args *pargs) if (pszXferIDs) { for (pszMsgNum = strtok(pszXferIDs, ", "); pszMsgNum; pszMsgNum = strtok(NULL, ", ")) { if (pszStatus = SkypeGetErrID("FILETRANSFER", pszMsgNum, "STATUS")) { - if (strcmp(pszStatus, "COMPLETED")) bAllComplete = FALSE; + if (mir_strcmp(pszStatus, "COMPLETED")) bAllComplete = FALSE; free(pszStatus); if (!bAllComplete) break; } @@ -324,7 +324,7 @@ void FXHandleMessageThread(ft_args *pargs) if (pszXferIDs) { for (pszMsgNum = strtok(pszXferIDs, ", "), i = 0; pszMsgNum; pszMsgNum = strtok(NULL, ", "), i++) { DWORD dwTransferred; - BOOL bIsCurFil = strcmp(pargs->szNum, pszMsgNum) == 0; + BOOL bIsCurFil = mir_strcmp(pargs->szNum, pszMsgNum) == 0; if (bIsCurFil) pfts.currentFileNumber = i; diff --git a/protocols/SkypeClassic/src/gchat.cpp b/protocols/SkypeClassic/src/gchat.cpp index 55865b0c2a..e59785a5e3 100644 --- a/protocols/SkypeClassic/src/gchat.cpp +++ b/protocols/SkypeClassic/src/gchat.cpp @@ -184,7 +184,7 @@ MCONTACT find_chatA(char *chatname) { { DBVARIANT dbv; if (!db_get_s(hContact, SKYPE_PROTONAME, "ChatRoomID", &dbv)) { - int tCompareResult = strcmp(dbv.pszVal, chatname); + int tCompareResult = mir_strcmp(dbv.pszVal, chatname); db_free(&dbv); if (!tCompareResult) return hContact; // already there, return handle @@ -225,7 +225,7 @@ int __cdecl AddMembers(char *szSkypeMsg) { break; } if (!(who = SkypeGet ("CHATMEMBER", token, "IDENTITY"))) continue; - if (strcmp(who, dbv2.pszVal)) { + if (mir_strcmp(who, dbv2.pszVal)) { TCHAR *ptszRole = NULL; char *pszRole = SkypeGet("CHATMEMBER", token, "ROLE"); @@ -256,7 +256,7 @@ int __cdecl AddMembers(char *szSkypeMsg) { iRet = -1; break; } - if (strcmp(who, dbv2.pszVal)) { + if (mir_strcmp(who, dbv2.pszVal)) { i=AddChatContact(gc, who, NULL); BYTE *pcontactmask; if (i<0 || !(pcontactmask= (BYTE *) realloc(contactmask, gc->mJoinedCount))) { diff --git a/protocols/SkypeClassic/src/skype.cpp b/protocols/SkypeClassic/src/skype.cpp index 7a28811213..4204b25ece 100644 --- a/protocols/SkypeClassic/src/skype.cpp +++ b/protocols/SkypeClassic/src/skype.cpp @@ -255,7 +255,7 @@ int ShowMessageA(int iconID, char *lpzText, int mustShow) { int HookContactAdded(WPARAM wParam, LPARAM) { MCONTACT hContact = (MCONTACT) wParam; char *szProto = GetContactProto(hContact); - if (szProto != NULL && !strcmp(szProto, SKYPE_PROTONAME)) + if (szProto != NULL && !mir_strcmp(szProto, SKYPE_PROTONAME)) add_contextmenu(hContact); return 0; } @@ -263,7 +263,7 @@ int HookContactAdded(WPARAM wParam, LPARAM) { int HookContactDeleted(WPARAM wParam, LPARAM) { MCONTACT hContact = (MCONTACT) wParam; char *szProto = GetContactProto(hContact); - if (szProto != NULL && !strcmp(szProto, SKYPE_PROTONAME)) { + if (szProto != NULL && !mir_strcmp(szProto, SKYPE_PROTONAME)) { DBVARIANT dbv; if (db_get_s(hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return 1; int retval = SkypeSend("SET USER %s BUDDYSTATUS 1", dbv.pszVal); @@ -582,7 +582,7 @@ void __cdecl SearchRecentChats(void *) { char *pszStatus = SkypeGet("CHAT", token, "STATUS"); if (pszStatus) { - if (!strcmp(pszStatus, "MULTI_SUBSCRIBED")) { + if (!mir_strcmp(pszStatus, "MULTI_SUBSCRIBED")) { // Add chatrooms for active multisubscribed chats /*if (!find_chatA(token)) */ EnterCriticalSection(&QueryThreadMutex); @@ -914,26 +914,26 @@ void FetchMessageThread(fetchmsg_arg *pargs) { // Get chat status if ((status = SkypeGetErr("CHAT", chat, "STATUS")) && - !strcmp(status, "MULTI_SUBSCRIBED")) isGroupChat = TRUE; + !mir_strcmp(status, "MULTI_SUBSCRIBED")) isGroupChat = TRUE; // Get chat type if (!(type = SkypeGetErr(cmdMessage, args.msgnum, "TYPE"))) __leave; - bEmoted = strcmp(type, "EMOTED") == 0; - if (strcmp(type, "MULTI_SUBSCRIBED") == 0) isGroupChat = TRUE; + bEmoted = mir_strcmp(type, "EMOTED") == 0; + if (mir_strcmp(type, "MULTI_SUBSCRIBED") == 0) isGroupChat = TRUE; // Group chat handling - if (isGroupChat && strcmp(type, "TEXT") && strcmp(type, "SAID") && strcmp(type, "UNKNOWN") && !bEmoted) { + if (isGroupChat && mir_strcmp(type, "TEXT") && mir_strcmp(type, "SAID") && mir_strcmp(type, "UNKNOWN") && !bEmoted) { if (bUseGroupChat) { BOOL bAddedMembers = FALSE; - if (!strcmp(type, "SAWMEMBERS") || !strcmp(type, "CREATEDCHATWITH")) + if (!mir_strcmp(type, "SAWMEMBERS") || !mir_strcmp(type, "CREATEDCHATWITH")) { // We have a new Groupchat LOG(("FetchMessageThread CHAT SAWMEMBERS")); if (!hChat) ChatStart(chat, FALSE); __leave; } - if (!strcmp(type, "KICKED")) + if (!mir_strcmp(type, "KICKED")) { if (!hChat) __leave; GCDEST gcd = { SKYPE_PROTONAME, make_nonutf_tchar_string((const unsigned char*)chat), GC_EVENT_KICK }; @@ -963,7 +963,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) { free_nonutf_tchar_string((void*)gcd.ptszID); __leave; } - if (!strcmp(type, "SETROLE")) + if (!mir_strcmp(type, "SETROLE")) { gchat_contact *gcContact; char *pszRole; @@ -1016,7 +1016,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) { free_nonutf_tchar_string((void*)gcd.ptszID); __leave; } - if (!strcmp(type, "SETTOPIC")) + if (!mir_strcmp(type, "SETTOPIC")) { LOG(("FetchMessageThread CHAT SETTOPIC")); GCDEST gcd = { SKYPE_PROTONAME, make_nonutf_tchar_string((const unsigned char*)chat), GC_EVENT_TOPIC }; @@ -1050,7 +1050,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) { } __leave; } - if (!strcmp(type, "LEFT") || (bAddedMembers = strcmp(type, "ADDEDMEMBERS") == 0)) + if (!mir_strcmp(type, "LEFT") || (bAddedMembers = mir_strcmp(type, "ADDEDMEMBERS") == 0)) { LOG(("FetchMessageThread CHAT LEFT or ADDEDMEMBERS")); if (bAddedMembers) { @@ -1064,7 +1064,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) { if (who = SkypeGetErr(cmdMessage, args.msgnum, szPartnerHandle)) { DBVARIANT dbv; if (db_get_s(NULL, SKYPE_PROTONAME, SKYPE_NAME, &dbv) == 0) { - gce.bIsMe = strcmp(who, dbv.pszVal) == 0; + gce.bIsMe = mir_strcmp(who, dbv.pszVal) == 0; db_free(&dbv); } gce.ptszUID = make_nonutf_tchar_string((const unsigned char*)who); @@ -1103,7 +1103,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) { status = SkypeGetID(cmdMessage, args.msgnum, "STATUS"); if (protocol < 4) InterlockedDecrement(&rcvwatchers); if (!status) __leave; - if (!strcmp(status, "SENT")) direction = DBEF_SENT; + if (!mir_strcmp(status, "SENT")) direction = DBEF_SENT; free(status); } @@ -1113,7 +1113,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) { // Get contact handle LOG(("FetchMessageThread Finding contact handle")); db_get_s(NULL, SKYPE_PROTONAME, SKYPE_NAME, &dbv); - if (dbv.pszVal && !strcmp(who, dbv.pszVal)) + if (dbv.pszVal && !mir_strcmp(who, dbv.pszVal)) { // It's from me.. But to whom? // CHATMESSAGE .. USERS doesn't return anything, so we have to query the CHAT-Object @@ -1124,7 +1124,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) { char *pTok, *nextoken = 0; for (pTok = strtok_r(ptr, " ", &nextoken); pTok; pTok = strtok_r(NULL, " ", &nextoken)) { - if (strcmp(pTok, dbv.pszVal)) break; // Take the first dude in the list who is not me + if (mir_strcmp(pTok, dbv.pszVal)) break; // Take the first dude in the list who is not me } if (!pTok) { @@ -1150,7 +1150,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) { } } - if (strcmp(type, "FILETRANSFER") == 0) + if (mir_strcmp(type, "FILETRANSFER") == 0) { // Our custom Skypekit FILETRANSFER extension bHasFileXfer = TRUE; @@ -1376,7 +1376,7 @@ void FetchMessageThreadSync(fetchmsg_arg *pargs) { static int MsglCmpProc(const void *pstPElement, const void *pstPToFind) { - return strcmp((char*)((fetchmsg_arg*)pstPElement)->pMsgEntry, (char*)((fetchmsg_arg*)pstPToFind)->pMsgEntry); + return mir_strcmp((char*)((fetchmsg_arg*)pstPElement)->pMsgEntry, (char*)((fetchmsg_arg*)pstPToFind)->pMsgEntry); } void MessageListProcessingThread(char *str) { @@ -1432,7 +1432,7 @@ MCONTACT GetCallerContact(char *szSkypeMsg) for (hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) { if (db_get_s(hContact, SKYPE_PROTONAME, "SkypeOutNr", &dbv)) continue; - tCompareResult = strcmp(dbv.pszVal, szHandle); + tCompareResult = mir_strcmp(dbv.pszVal, szHandle); db_free(&dbv); if (tCompareResult) continue; else break; } @@ -1446,7 +1446,7 @@ MCONTACT GetMetaHandle(DWORD dwId) { for (MCONTACT hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) { char *szProto = GetContactProto(hContact); - if (szProto != NULL && !strcmp(szProto, "MetaContacts") && + if (szProto != NULL && !mir_strcmp(szProto, "MetaContacts") && db_get_dw(hContact, "MetaContacts", "MetaID", MAXDWORD) == dwId) return hContact; } @@ -1621,7 +1621,7 @@ void EndCallThread(char *szSkypeMsg) { if (szSkypeMsg) { for (hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) { if (db_get_s(hContact, SKYPE_PROTONAME, "CallId", &dbv)) continue; - int tCompareResult = strcmp(dbv.pszVal, szSkypeMsg); + int tCompareResult = mir_strcmp(dbv.pszVal, szSkypeMsg); db_free(&dbv); if (!tCompareResult) break; @@ -1646,7 +1646,7 @@ void EndCallThread(char *szSkypeMsg) { if (!db_get_s(hContact, SKYPE_PROTONAME, "SkypeOutNr", &dbv)) { db_free(&dbv); - if (!strcmp((char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0), SKYPE_PROTONAME) && + if (!mir_strcmp((char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0), SKYPE_PROTONAME) && db_get_b(hContact, "CList", "NotOnList", 0) ) CallService(MS_DB_CONTACT_DELETE, hContact, 0); @@ -1797,7 +1797,7 @@ LRESULT APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) if (p = strtok_r(szSkypeMsg + 29, " ", &nextoken)) { - if (!strcmp(p, "STREAMS")) { + if (!mir_strcmp(p, "STREAMS")) { char *pStr; while (p = strtok_r(NULL, " ", &nextoken)) { @@ -1810,7 +1810,7 @@ LRESULT APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) } } } - else if (!strcmp(p, "DATAGRAM")) { + else if (!mir_strcmp(p, "DATAGRAM")) { if (p = strtok_r(NULL, " ", &nextoken)) { char *pStr; @@ -1823,7 +1823,7 @@ LRESULT APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) if (p = strtok_r(NULL, " ", &nextoken)) { LPARAM lTyping = PROTOTYPE_CONTACTTYPING_OFF; - if (!strcmp(p, "PURPLE_TYPING")) lTyping = PROTOTYPE_CONTACTTYPING_INFINITE; + if (!mir_strcmp(p, "PURPLE_TYPING")) lTyping = PROTOTYPE_CONTACTTYPING_INFINITE; CallService(MS_PROTO_CONTACTISTYPING, hContact, lTyping); break; } @@ -1839,20 +1839,20 @@ LRESULT APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) buf = _strdup(szSkypeMsg + 5); if ((nick = strtok_r(buf, " ", &nextoken)) && (ptr = strtok_r(NULL, " ", &nextoken))) { - if (strcmp(ptr, "BUDDYSTATUS")) { - if (!strcmp(ptr, "RECEIVEDAUTHREQUEST")) { + if (mir_strcmp(ptr, "BUDDYSTATUS")) { + if (!mir_strcmp(ptr, "RECEIVEDAUTHREQUEST")) { pthread_create((pThreadFunc)ProcessAuthRq, strdup(szSkypeMsg)); free(buf); break; } - if (!(hContact = find_contact(nick)) && strcmp(ptr, "FULLNAME")) { + if (!(hContact = find_contact(nick)) && mir_strcmp(ptr, "FULLNAME")) { SkypeSend("GET USER %s BUDDYSTATUS", nick); free(buf); break; } - if (!strcmp(ptr, "ONLINESTATUS")) { + if (!mir_strcmp(ptr, "ONLINESTATUS")) { if (SkypeStatus != ID_STATUS_OFFLINE) { db_set_w(hContact, SKYPE_PROTONAME, "Status", (WORD)SkypeStatusToMiranda(ptr + 13)); @@ -1882,7 +1882,7 @@ LRESULT APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) * This may not be the most efficient way, but ensures that we finally do proper * error handling. */ - if (!strcmp(ptr, "FULLNAME")) { + if (!mir_strcmp(ptr, "FULLNAME")) { char *nm = strtok_r(NULL, " ", &nextoken); if (nm) @@ -1894,7 +1894,7 @@ LRESULT APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) db_set_utf(hContact, SKYPE_PROTONAME, "LastName", nm); } } - else if (!strcmp(ptr, "BIRTHDAY")) { + else if (!mir_strcmp(ptr, "BIRTHDAY")) { int y, m, d; if (sscanf(ptr + 9, "%04d%02d%02d", &y, &m, &d) == 3) { db_set_w(hContact, SKYPE_PROTONAME, "BirthYear", (WORD)y); @@ -1907,7 +1907,7 @@ LRESULT APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) db_unset(hContact, SKYPE_PROTONAME, "BirthDay"); } } - else if (!strcmp(ptr, "COUNTRY")) { + else if (!mir_strcmp(ptr, "COUNTRY")) { if (ptr[8]) { struct CountryListEntry *countries; int countryCount; @@ -1923,7 +1923,7 @@ LRESULT APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) } else db_unset(hContact, SKYPE_PROTONAME, "Country"); } - else if (!strcmp(ptr, "SEX")) { + else if (!mir_strcmp(ptr, "SEX")) { if (ptr[4]) { BYTE sex = 0; if (!_stricmp(ptr + 4, "MALE")) sex = 0x4D; @@ -1932,11 +1932,11 @@ LRESULT APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) } else db_unset(hContact, SKYPE_PROTONAME, "Gender"); } - else if (!strcmp(ptr, "MOOD_TEXT")) { + else if (!mir_strcmp(ptr, "MOOD_TEXT")) { LOG(("WndProc MOOD_TEXT")); db_set_utf(hContact, "CList", "StatusMsg", ptr + 10); } - else if (!strcmp(ptr, "TIMEZONE")){ + else if (!mir_strcmp(ptr, "TIMEZONE")){ time_t temp; struct tm tms; int value = atoi(ptr + 9), tz; @@ -1965,22 +1965,22 @@ LRESULT APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) db_unset(hContact, "UserInfo", "Timezone"); } } - else if (!strcmp(ptr, "IS_VIDEO_CAPABLE")){ + else if (!mir_strcmp(ptr, "IS_VIDEO_CAPABLE")){ if (!_stricmp(ptr + 17, "True")) db_set_s(hContact, SKYPE_PROTONAME, "MirVer", "Skype 2.0"); else db_set_s(hContact, SKYPE_PROTONAME, "MirVer", "Skype"); } - else if (!strcmp(ptr, "ISBLOCKED")){ + else if (!mir_strcmp(ptr, "ISBLOCKED")){ if (!_stricmp(ptr + 10, "True")) db_set_b(hContact, SKYPE_PROTONAME, "IsBlocked", 1); else db_unset(hContact, SKYPE_PROTONAME, "IsBlocked"); } - else if (!strcmp(ptr, "RICH_MOOD_TEXT")) { + else if (!mir_strcmp(ptr, "RICH_MOOD_TEXT")) { db_set_s(hContact, SKYPE_PROTONAME, "MirVer", "Skype 3.0"); } - else if (!strcmp(ptr, "DISPLAYNAME")) { + else if (!mir_strcmp(ptr, "DISPLAYNAME")) { // Skype Bug? -> If nickname isn't customised in the Skype-App, this won't return anything :-( if (ptr[12]) db_set_utf(hContact, SKYPE_PROTONAME, "Nick", ptr + 12); @@ -1989,7 +1989,7 @@ LRESULT APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) { // Other proerties that can be directly assigned to a DB-Value for (int i = 0; i < sizeof(m_settings) / sizeof(m_settings[0]); i++) { - if (!strcmp(ptr, m_settings[i].SkypeSetting)) { + if (!mir_strcmp(ptr, m_settings[i].SkypeSetting)) { char *pszProp = ptr + mir_strlen(m_settings[i].SkypeSetting) + 1; if (*pszProp) db_set_utf(hContact, SKYPE_PROTONAME, m_settings[i].MirandaSetting, pszProp); @@ -2086,14 +2086,14 @@ LRESULT APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) // context menu if (ptr = strstr(szSkypeMsg, " STATUS ")) { ptr[0] = 0; ptr += 8; - if (!strcmp(ptr, "RINGING") || !strcmp(ptr, "ROUTING")) pthread_create((pThreadFunc)RingThread, _strdup(szSkypeMsg)); - if (!strcmp(ptr, "FAILED") || !strcmp(ptr, "FINISHED") || - !strcmp(ptr, "MISSED") || !strcmp(ptr, "REFUSED") || - !strcmp(ptr, "BUSY") || !strcmp(ptr, "CANCELLED")) + if (!mir_strcmp(ptr, "RINGING") || !mir_strcmp(ptr, "ROUTING")) pthread_create((pThreadFunc)RingThread, _strdup(szSkypeMsg)); + if (!mir_strcmp(ptr, "FAILED") || !mir_strcmp(ptr, "FINISHED") || + !mir_strcmp(ptr, "MISSED") || !mir_strcmp(ptr, "REFUSED") || + !mir_strcmp(ptr, "BUSY") || !mir_strcmp(ptr, "CANCELLED")) pthread_create((pThreadFunc)EndCallThread, _strdup(szSkypeMsg)); - if (!strcmp(ptr, "ONHOLD") || !strcmp(ptr, "LOCALHOLD") || - !strcmp(ptr, "REMOTEHOLD")) pthread_create((pThreadFunc)HoldCallThread, _strdup(szSkypeMsg)); - if (!strcmp(ptr, "INPROGRESS")) pthread_create((pThreadFunc)ResumeCallThread, _strdup(szSkypeMsg)); + if (!mir_strcmp(ptr, "ONHOLD") || !mir_strcmp(ptr, "LOCALHOLD") || + !mir_strcmp(ptr, "REMOTEHOLD")) pthread_create((pThreadFunc)HoldCallThread, _strdup(szSkypeMsg)); + if (!mir_strcmp(ptr, "INPROGRESS")) pthread_create((pThreadFunc)ResumeCallThread, _strdup(szSkypeMsg)); break; } else if ((!strstr(szSkypeMsg, "PARTNER_HANDLE") && !strstr(szSkypeMsg, "FROM_HANDLE")) @@ -2625,7 +2625,7 @@ static INT_PTR EventAddHook(WPARAM wParam, LPARAM lParam) MCONTACT hContact = (MCONTACT)wParam; DBEVENTINFO *dbei=(DBEVENTINFO*)lParam; if (dbei && hContact == m_AddEventArg.hContact && dbei->eventType==EVENTTYPE_MESSAGE && (dbei->flags & DBEF_SENT) && - strcmp(dbei->szModule, SKYPE_PROTONAME) == 0) { + mir_strcmp(dbei->szModule, SKYPE_PROTONAME) == 0) { dbei->timestamp = m_AddEventArg.timestamp; } return 0; @@ -2830,7 +2830,7 @@ char *__skypeauth(WPARAM wParam) { return NULL; } - if (db_event_get(wParam, &dbei) || dbei.eventType != EVENTTYPE_AUTHREQUEST || strcmp(dbei.szModule, SKYPE_PROTONAME)) + if (db_event_get(wParam, &dbei) || dbei.eventType != EVENTTYPE_AUTHREQUEST || mir_strcmp(dbei.szModule, SKYPE_PROTONAME)) { free(dbei.pBlob); return NULL; @@ -2983,7 +2983,7 @@ int AnySkypeusers(void) // GETCONTACTBASEPROTO doesn't work on not loaded protocol, therefore get // protocol from DB if (db_get_s(hContact, "Protocol", "p", &dbv)) continue; - tCompareResult = !strcmp(dbv.pszVal, SKYPE_PROTONAME); + tCompareResult = !mir_strcmp(dbv.pszVal, SKYPE_PROTONAME); db_free(&dbv); if (tCompareResult) return 1; } @@ -3030,7 +3030,7 @@ free(pdi.szSettings); } // Upgrade Protocol assignment, if we are not main contact if (hContact && !db_get_s(hContact, "Protocol", "p", &dbv)) { -if (!strcmp(dbv.pszVal, OldName)) +if (!mir_strcmp(dbv.pszVal, OldName)) db_set_s(hContact, "Protocol", "p", SKYPE_PROTONAME); db_free(&dbv); } diff --git a/protocols/SkypeClassic/src/skypeapi.cpp b/protocols/SkypeClassic/src/skypeapi.cpp index 35b4117560..5c464bae39 100644 --- a/protocols/SkypeClassic/src/skypeapi.cpp +++ b/protocols/SkypeClassic/src/skypeapi.cpp @@ -353,7 +353,7 @@ static int __sendMsg(char *szMsg) { LOG(("> %s", szMsg)); // Fake PING-PONG, as PING-PONG is not supported by Skype2Socket - if ((UseSockets || bIsImoproxy) && !strcmp(szMsg, "PING")) { + if ((UseSockets || bIsImoproxy) && !mir_strcmp(szMsg, "PING")) { CopyData.dwData=0; CopyData.lpData="PONG"; CopyData.cbData=5; @@ -536,7 +536,7 @@ char *SkypeRcvMsg(char *what, time_t st, MCONTACT hContact, DWORD maxwait) pMsg++; if (strncmp (pMsg, "STATUS ", 7) == 0) { pMsg+=7; - if (strcmp (pMsg, "SENDING") == 0) { + if (mir_strcmp (pMsg, "SENDING") == 0) { // Remove dat shit struct MsgQueue *ptr_=ptr->l.tqe_next; @@ -544,9 +544,9 @@ char *SkypeRcvMsg(char *what, time_t st, MCONTACT hContact, DWORD maxwait) ptr=ptr_; continue; } - bProcess = (strcmp (pMsg, "SENT") == 0 || strcmp (pMsg, "QUEUED") == 0 || - strcmp (pMsg, "FAILED") == 0 || strcmp (pMsg, "IGNORED") == 0 || - strcmp (pMsg, "SENDING") == 0); + bProcess = (mir_strcmp (pMsg, "SENT") == 0 || mir_strcmp (pMsg, "QUEUED") == 0 || + mir_strcmp (pMsg, "FAILED") == 0 || mir_strcmp (pMsg, "IGNORED") == 0 || + mir_strcmp (pMsg, "SENDING") == 0); } } } @@ -907,7 +907,7 @@ static INT_PTR CALLBACK CallstatDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, // Check, if another call is in progress for (hContact=db_find_first();hContact != NULL;hContact=db_find_next(hContact)) { char *szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, hContact, 0 ); - if (szProto != NULL && !strcmp(szProto, SKYPE_PROTONAME) && hContact != (MCONTACT)lParam && + if (szProto != NULL && !mir_strcmp(szProto, SKYPE_PROTONAME) && hContact != (MCONTACT)lParam && db_get_b(hContact, SKYPE_PROTONAME, "ChatRoom", 0) == 0 && !db_get_s(hContact, SKYPE_PROTONAME, "CallId", &dbv2)) { @@ -1319,10 +1319,10 @@ void SkypeFlush(void) { * 0 - Nothing found */ int SkypeStatusToMiranda(char *s) { - if (!strcmp("SKYPEOUT", s)) + if (!mir_strcmp("SKYPEOUT", s)) return db_get_dw(NULL, SKYPE_PROTONAME, "SkypeOutStatusMode", ID_STATUS_ONTHEPHONE); for(int i=0; status_codes[i].szStat; i++) - if (!strcmp(status_codes[i].szStat, s)) + if (!mir_strcmp(status_codes[i].szStat, s)) return status_codes[i].id; return 0; } @@ -1583,7 +1583,7 @@ static int _ConnectToSkypeAPI(char *path, int iStart) { return -1; } - if (strcmp (ptr+11, "CONNECTING")) + if (mir_strcmp (ptr+11, "CONNECTING")) { free (ptr); break; diff --git a/protocols/SkypeClassic/src/skypeproxy/skypeproxy.c b/protocols/SkypeClassic/src/skypeproxy/skypeproxy.c index fe3b88e363..65ba2e0ccc 100644 --- a/protocols/SkypeClassic/src/skypeproxy/skypeproxy.c +++ b/protocols/SkypeClassic/src/skypeproxy/skypeproxy.c @@ -299,7 +299,7 @@ void SkypeSend(char *szMsg) { LOG(("SkypeSend: DAMN! No Skype window handle! :(")); return; } - if (strcmp(szMsg, "PING")) {LOG(("> %s", szMsg));} + if (mir_strcmp(szMsg, "PING")) {LOG(("> %s", szMsg));} CopyData.dwData=0; CopyData.lpData=szMsg; CopyData.cbData=strlen(szMsg)+1; @@ -379,7 +379,7 @@ void ServerThread(char *dummy) { switch (command) { #ifdef USE_AUTHENTICATION case 0x01: // Compare hash - if (password && !strcmp(password, buf)) Authenticated=TRUE; + if (password && !mir_strcmp(password, buf)) Authenticated=TRUE; else Authenticated=FALSE; if (Authenticated) { OUTPUT("User authenticated succesfully."); @@ -439,12 +439,12 @@ LONG APIENTRY WndProc(HWND hWnd, UINT message, UINT wParam, LONG lParam) CopyData=(PCOPYDATASTRUCT)lParam; szSkypeMsg=strdup(CopyData->lpData); ReplyMessage(1); - if (!strcmp(szSkypeMsg, "PONG")) { + if (!mir_strcmp(szSkypeMsg, "PONG")) { WatchDog=1; break; } // Hide PING-PONG LOG(("< %s", szSkypeMsg)); - if (!strcmp(szSkypeMsg, "USERSTATUS LOGGEDOUT")) { + if (!mir_strcmp(szSkypeMsg, "USERSTATUS LOGGEDOUT")) { OUTPUT("Skype shut down gracefully. I'll leave too, bye.. :)"); bail_out(1); } -- cgit v1.2.3