diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-22 12:33:13 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-22 12:33:13 +0000 |
commit | 159b565b390687258ee65a3b66596e118752063c (patch) | |
tree | 91105378fcb9e030ba4a7f6572c4ea307cb8c8d6 /protocols/SkypeClassic/src/skype.cpp | |
parent | 7f4d529b59698d7eb2403bd1f9088a5aa7fa9080 (diff) |
replace strcmp to mir_strcmp
git-svn-id: http://svn.miranda-ng.org/main/trunk@13752 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeClassic/src/skype.cpp')
-rw-r--r-- | protocols/SkypeClassic/src/skype.cpp | 102 |
1 files changed, 51 insertions, 51 deletions
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);
}
|