diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2015-05-22 19:49:01 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2015-05-22 19:49:01 +0000 |
commit | a89887eb202c99ce09107668561abce6704f9004 (patch) | |
tree | ad16b7333f033ee98f02d342ba70ae5fca8030b5 /protocols/IcqOscarJ/src | |
parent | 1eb922f8075c53a1a8487045b096693bd27b56dd (diff) |
more replacements
git-svn-id: http://svn.miranda-ng.org/main/trunk@13762 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ/src')
20 files changed, 59 insertions, 86 deletions
diff --git a/protocols/IcqOscarJ/src/db.cpp b/protocols/IcqOscarJ/src/db.cpp index 4080b800ff..1d4254b52e 100644 --- a/protocols/IcqOscarJ/src/db.cpp +++ b/protocols/IcqOscarJ/src/db.cpp @@ -138,7 +138,7 @@ static INT_PTR CALLBACK PwConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, GetDlgItemTextA(hwndDlg, IDC_OLDPASS, szTest, SIZEOF(szTest));
- if (strcmpnull(szTest, dat->ppro->GetUserPassword(TRUE))) {
+ if (mir_strcmp(szTest, dat->ppro->GetUserPassword(TRUE))) {
MessageBox(hwndDlg, TranslateT("The password does not match your current password. Check Caps Lock and try again."), TranslateT("Change ICQ Details"), MB_OK);
SendDlgItemMessage(hwndDlg, IDC_OLDPASS, EM_SETSEL, 0, (LPARAM)-1);
SetFocus(GetDlgItem(hwndDlg, IDC_OLDPASS));
@@ -146,7 +146,7 @@ static INT_PTR CALLBACK PwConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, }
GetDlgItemTextA(hwndDlg, IDC_PASSWORD, szTest, SIZEOF(szTest));
- if (strcmpnull(szTest, dat->Pass)) {
+ if (mir_strcmp(szTest, dat->Pass)) {
MessageBox(hwndDlg, TranslateT("The password does not match the password you originally entered. Check Caps Lock and try again."), TranslateT("Change ICQ Details"), MB_OK);
SendDlgItemMessage(hwndDlg, IDC_PASSWORD, EM_SETSEL, 0, (LPARAM)-1);
SetFocus(GetDlgItem(hwndDlg, IDC_PASSWORD));
diff --git a/protocols/IcqOscarJ/src/editlist.cpp b/protocols/IcqOscarJ/src/editlist.cpp index 03218b9836..da04c5efc1 100644 --- a/protocols/IcqOscarJ/src/editlist.cpp +++ b/protocols/IcqOscarJ/src/editlist.cpp @@ -115,8 +115,8 @@ void ChangeInfoData::BeginListEdit(int iItem, RECT *rc, int iSetting, WORD wVKey char str[MAX_PATH];
n = ListBoxAddStringUtf(hwndListEdit, list[j].text);
SendMessage(hwndListEdit, LB_SETITEMDATA, n, j);
- if ((si.dbType == DBVT_ASCIIZ && (!strcmpnull((char*)sid.value, list[j].text))
- || (si.dbType == DBVT_ASCIIZ && (!strcmpnull((char*)sid.value, ICQTranslateUtfStatic(list[j].text, str, MAX_PATH))))
+ if ((si.dbType == DBVT_ASCIIZ && (!mir_strcmp((char*)sid.value, list[j].text))
+ || (si.dbType == DBVT_ASCIIZ && (!mir_strcmp((char*)sid.value, ICQTranslateUtfStatic(list[j].text, str, MAX_PATH))))
|| ((char*)sid.value == NULL && list[j].code == 0))
|| (si.dbType != DBVT_ASCIIZ && sid.value == list[j].code))
SendMessage(hwndListEdit, LB_SETCURSEL, n, 0);
@@ -158,7 +158,7 @@ void ChangeInfoData::EndListEdit(int save) if (si.dbType == DBVT_ASCIIZ) {
char *szNewValue = pItem.text;
if (pItem.code || (si.displayType & LIF_ZEROISVALID)) {
- sid.changed = strcmpnull(szNewValue, (char*)sid.value);
+ sid.changed = mir_strcmp(szNewValue, (char*)sid.value);
SAFE_FREE((void**)&sid.value);
sid.value = (LPARAM)null_strdup(szNewValue);
}
diff --git a/protocols/IcqOscarJ/src/editstring.cpp b/protocols/IcqOscarJ/src/editstring.cpp index b73ae9e6a5..f792660d52 100644 --- a/protocols/IcqOscarJ/src/editstring.cpp +++ b/protocols/IcqOscarJ/src/editstring.cpp @@ -309,8 +309,8 @@ void ChangeInfoData::EndStringEdit(int save) text = GetWindowTextUtf(hwndEdit);
EscapesToBinary(text);
}
- if ((si.displayType & LIF_PASSWORD && strcmpnull(text, " ")) ||
- (!(si.displayType & LIF_PASSWORD) && strcmpnull(text, (char*)sid.value) && (mir_strlen(text) + mir_strlen((char*)sid.value)))) {
+ if ((si.displayType & LIF_PASSWORD && mir_strcmp(text, " ")) ||
+ (!(si.displayType & LIF_PASSWORD) && mir_strcmp(text, (char*)sid.value) && (mir_strlen(text) + mir_strlen((char*)sid.value)))) {
SAFE_FREE((void**)&sid.value);
if (mir_strlen(text))
sid.value = (LPARAM)text;
diff --git a/protocols/IcqOscarJ/src/fam_03buddy.cpp b/protocols/IcqOscarJ/src/fam_03buddy.cpp index 0c862db64e..36b3abd116 100644 --- a/protocols/IcqOscarJ/src/fam_03buddy.cpp +++ b/protocols/IcqOscarJ/src/fam_03buddy.cpp @@ -382,7 +382,7 @@ void CIcqProto::handleUserOnline(BYTE *buf, size_t wLen, serverthread_info*) szClient = detectUserClient(hContact, nIsICQ, wClass, dwOnlineSince, szCurrentClient, wVersion, dwFT1, dwFT2, dwFT3, dwDirectConnCookie, dwWebPort, capBuf, capLen, &bClientId, szStrBuf);
// Check if the client changed, if not do not change
- if (szCurrentClient && !strcmpnull(szCurrentClient, szClient))
+ if (szCurrentClient && !mir_strcmp(szCurrentClient, szClient))
szClient = (const char*)-1;
SAFE_FREE(&szCurrentClient);
}
diff --git a/protocols/IcqOscarJ/src/fam_13servclist.cpp b/protocols/IcqOscarJ/src/fam_13servclist.cpp index aa1a487ad1..a9faf4b891 100644 --- a/protocols/IcqOscarJ/src/fam_13servclist.cpp +++ b/protocols/IcqOscarJ/src/fam_13servclist.cpp @@ -810,11 +810,11 @@ void CIcqProto::handleServerCListReply(BYTE *buf, size_t wLen, WORD wFlags, serv szLocalGroup = null_strdup(DEFAULT_SS_GROUP); } - if (strcmpnull(szActiveSrvGroup, szLocalGroup) && + if (mir_strcmp(szActiveSrvGroup, szLocalGroup) && (mir_strlen(szActiveSrvGroup) >= mir_strlen(szLocalGroup) || (szActiveSrvGroup && _strnicmp(szActiveSrvGroup, szLocalGroup, mir_strlen(szLocalGroup))))) { // contact moved to new group or sub-group or not to master group bRegroup = 1; } - if (bRegroup && !stricmpnull(DEFAULT_SS_GROUP, szActiveSrvGroup)) /// TODO: invent something more clever for "root" group + if (bRegroup && !mir_strcmpi(DEFAULT_SS_GROUP, szActiveSrvGroup)) /// TODO: invent something more clever for "root" group { // is it the default "General" group ? bRegroup = 0; // if yes, do not move to it - cause it would hide the contact } @@ -855,7 +855,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, size_t wLen, WORD wFlags, serv char *szOldNick; if (szOldNick = getSettingStringUtf(hContact, "CList", "MyHandle", NULL)) { - if ((strcmpnull(szOldNick, pszNick)) && (mir_strlen(pszNick) > 0)) { // check if the truncated nick changed, i.e. do not overwrite locally stored longer nick + if ((mir_strcmp(szOldNick, pszNick)) && (mir_strlen(pszNick) > 0)) { // check if the truncated nick changed, i.e. do not overwrite locally stored longer nick if (mir_strlen(szOldNick) <= mir_strlen(pszNick) || strncmp(szOldNick, pszNick, null_strcut(szOldNick, MAX_SSI_TLV_NAME_SIZE))) { // Yes, we really do need to delete it first. Otherwise the CLUI nick // cache isn't updated (I'll look into it) @@ -898,7 +898,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, size_t wLen, WORD wFlags, serv char *szOldComment; if (szOldComment = getSettingStringUtf(hContact, "UserInfo", "MyNotes", NULL)) { - if ((strcmpnull(szOldComment, pszComment)) && (mir_strlen(pszComment) > 0)) // check if the truncated comment changed, i.e. do not overwrite locally stored longer comment + if ((mir_strcmp(szOldComment, pszComment)) && (mir_strlen(pszComment) > 0)) // check if the truncated comment changed, i.e. do not overwrite locally stored longer comment if (mir_strlen(szOldComment) <= mir_strlen(pszComment) || strncmp((char*)szOldComment, (char*)pszComment, null_strcut(szOldComment, MAX_SSI_TLV_COMMENT_SIZE))) db_set_utf(hContact, "UserInfo", "MyNotes", pszComment); @@ -1116,7 +1116,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, size_t wLen, WORD wFlags, serv /* data is TLV(D5) hash */ /* we ignore this, just save the id */ /* cause we get the hash again after login */ - if (!strcmpnull(szRecordName, "12")) { // need to handle Photo Item separately + if (!mir_strcmp(szRecordName, "12")) { // need to handle Photo Item separately setWord(DBSETTING_SERVLIST_PHOTO, wItemId); debugLogA("SSI %s item recognized", "Photo"); } diff --git a/protocols/IcqOscarJ/src/fam_15icqserver.cpp b/protocols/IcqOscarJ/src/fam_15icqserver.cpp index 09d6de130c..dfb2f43602 100644 --- a/protocols/IcqOscarJ/src/fam_15icqserver.cpp +++ b/protocols/IcqOscarJ/src/fam_15icqserver.cpp @@ -866,7 +866,7 @@ void CIcqProto::parseDirectoryUserDetailsData(MCONTACT hContact, oscar_tlv_chain char *szClientStatusNote = getSettingStringUtf(hContact, DBSETTING_STATUS_NOTE, NULL);
char *szDirectoryStatusNote = cDetails->getString(0x226, 1);
- if (strcmpnull(szClientStatusNote, szDirectoryStatusNote))
+ if (mir_strcmp(szClientStatusNote, szDirectoryStatusNote))
SetStatusNote(szClientStatusNote, 1000, TRUE);
// Release memory
diff --git a/protocols/IcqOscarJ/src/icq_clients.cpp b/protocols/IcqOscarJ/src/icq_clients.cpp index a517288901..6d1cf74ea9 100644 --- a/protocols/IcqOscarJ/src/icq_clients.cpp +++ b/protocols/IcqOscarJ/src/icq_clients.cpp @@ -998,7 +998,7 @@ const char* CIcqProto::detectUserClient( }
// Log the detection result if it has changed or contact just logged on...
- if (!szCurrentClient || strcmpnull(szCurrentClient, szClient)) {
+ if (!szCurrentClient || mir_strcmp(szCurrentClient, szClient)) {
if (bClientDetected)
debugLogA("Client identified as %s", szClient);
else
diff --git a/protocols/IcqOscarJ/src/icq_db.cpp b/protocols/IcqOscarJ/src/icq_db.cpp index 3ba378541f..971056a957 100644 --- a/protocols/IcqOscarJ/src/icq_db.cpp +++ b/protocols/IcqOscarJ/src/icq_db.cpp @@ -186,7 +186,7 @@ int CIcqProto::IsICQContact(MCONTACT hContact) {
char* szProto = GetContactProto(hContact);
- return !strcmpnull(szProto, m_szModuleName);
+ return !mir_strcmp(szProto, m_szModuleName);
}
MEVENT CIcqProto::AddEvent(MCONTACT hContact, WORD wType, DWORD dwTime, DWORD flags, size_t cbBlob, PBYTE pBlob)
diff --git a/protocols/IcqOscarJ/src/icq_opts.cpp b/protocols/IcqOscarJ/src/icq_opts.cpp index 6a319e06b5..ec5ff4f915 100644 --- a/protocols/IcqOscarJ/src/icq_opts.cpp +++ b/protocols/IcqOscarJ/src/icq_opts.cpp @@ -128,7 +128,7 @@ static INT_PTR CALLBACK DlgProcIcqOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP char szClass[80];
GetClassNameA((HWND)lParam, szClass, sizeof(szClass));
- if (stricmpnull(szClass, "EDIT") || HIWORD(wParam) == EN_CHANGE)
+ if (mir_strcmpi(szClass, "EDIT") || HIWORD(wParam) == EN_CHANGE)
ShowDlgItem(hwndDlg, IDC_RECONNECTREQD, SW_SHOW);
}
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index 3095247501..66446c6324 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -67,7 +67,7 @@ static int CompareContactsCache(const icq_contacts_cache *p1, const icq_contacts if (p1->dwUin > p2->dwUin)
return 1;
- return stricmpnull(p1->szUid, p2->szUid);
+ return mir_strcmpi(p1->szUid, p2->szUid);
}
CIcqProto::CIcqProto(const char* aProtoName, const TCHAR* aUserName) :
@@ -327,7 +327,7 @@ MCONTACT __cdecl CIcqProto::AddToListByEvent(int flags, int iContact, MEVENT hDb if (db_event_get(hDbEvent, &dbei))
return 0; // failed to get event
- if (strcmpnull(dbei.szModule, m_szModuleName))
+ if (mir_strcmp(dbei.szModule, m_szModuleName))
return 0; // this event is not ours
switch (dbei.eventType) {
@@ -1764,7 +1764,7 @@ int __cdecl CIcqProto::SetAwayMsg(int status, const TCHAR* msg) // Prepare UTF-8 status message
char *szNewUtf = tchar_to_utf8(msg);
- if (strcmpnull(szNewUtf, *ppszMsg)) {
+ if (mir_strcmp(szNewUtf, *ppszMsg)) {
// Free old message
SAFE_FREE(ppszMsg);
diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp index 5193f9049e..4c13f1fd8c 100644 --- a/protocols/IcqOscarJ/src/icq_servlist.cpp +++ b/protocols/IcqOscarJ/src/icq_servlist.cpp @@ -432,7 +432,7 @@ int CIcqProto::servlistPendingFindItem(int nType, MCONTACT hContact, const char for (int i = 0; i < servlistPendingCount; i++)
if (servlistPendingList[i]->nType == nType)
if (((nType == ITEM_PENDING_CONTACT) && (servlistPendingList[i]->hContact == hContact)) ||
- ((nType == ITEM_PENDING_GROUP) && (!strcmpnull(servlistPendingList[i]->szGroup, pszGroup))))
+ ((nType == ITEM_PENDING_GROUP) && (!mir_strcmp(servlistPendingList[i]->szGroup, pszGroup))))
return i;
return -1;
@@ -1509,7 +1509,7 @@ static int SrvGroupNamesEnumProc(const char *szSetting, LPARAM lParam) CIcqProto *ppro = (CIcqProto*)params[0];
char *szGroupName = ppro->getSettingStringUtf(NULL, params[3], szSetting, NULL);
- if (!strcmpnull(szGroupName, params[2]))
+ if (!mir_strcmp(szGroupName, params[2]))
params[1] = szSetting; // do not need the real value, just arbitrary non-NULL
SAFE_FREE(&szGroupName);
@@ -2139,7 +2139,7 @@ void CIcqProto::servlistRenameGroup(char *szGroup, WORD wGroupId, char *szNewGro szLast[0] = '\0';
// this group was not changed, nothing to rename
- if (!strcmpnull(szGroupName, szNewGroupName)) return;
+ if (!mir_strcmp(szGroupName, szNewGroupName)) return;
szGroupName = szNewGroupName;
szNewGroupName = (char*)SAFE_MALLOC(mir_strlen(szGroupName) + 1 + nGroupLevel);
@@ -2268,20 +2268,20 @@ int CIcqProto::ServListDbSettingChanged(WPARAM hContact, LPARAM lParam) if (!icqOnline() || !m_bSsiEnabled || bIsSyncingCL)
return 0;
- if (!strcmpnull(cws->szModule, "CList")) {
+ if (!mir_strcmp(cws->szModule, "CList")) {
// Has contact been renamed?
- if (!strcmpnull(cws->szSetting, "MyHandle") && getByte("StoreServerDetails", DEFAULT_SS_STORE))
+ if (!mir_strcmp(cws->szSetting, "MyHandle") && getByte("StoreServerDetails", DEFAULT_SS_STORE))
servlistUpdateContact(hContact); // Update contact's details in server-list
// Has contact been moved to another group?
- if (!strcmpnull(cws->szSetting, "Group") && getByte("StoreServerDetails", DEFAULT_SS_STORE)) {
+ if (!mir_strcmp(cws->szSetting, "Group") && getByte("StoreServerDetails", DEFAULT_SS_STORE)) {
char* szNewGroup = getContactCListGroup(hContact); // Read group from DB
SAFE_FREE(&szNewGroup);
}
}
- else if (!strcmpnull(cws->szModule, "UserInfo")) {
+ else if (!mir_strcmp(cws->szModule, "UserInfo")) {
// Update contact's details in server-list
- if (!strcmpnull(cws->szSetting, "MyNotes") && getByte("StoreServerDetails", DEFAULT_SS_STORE))
+ if (!mir_strcmp(cws->szSetting, "MyNotes") && getByte("StoreServerDetails", DEFAULT_SS_STORE))
servlistUpdateContact(hContact);
}
diff --git a/protocols/IcqOscarJ/src/icq_uploadui.cpp b/protocols/IcqOscarJ/src/icq_uploadui.cpp index 793eaa4b4e..d99f10f2bc 100644 --- a/protocols/IcqOscarJ/src/icq_uploadui.cpp +++ b/protocols/IcqOscarJ/src/icq_uploadui.cpp @@ -287,7 +287,7 @@ static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg, UINT message, WPARAM wPa char str[MAX_PATH];
// Is this an ack we are waiting for?
- if (strcmpnull(ack->szModule, ppro->m_szModuleName))
+ if (mir_strcmp(ack->szModule, ppro->m_szModuleName))
break;
if (ack->type == ICQACKTYPE_RATEWARNING) { // we are sending tooo fast, slow down the process
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp index 099b03945f..558372b04d 100644 --- a/protocols/IcqOscarJ/src/icq_xstatus.cpp +++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp @@ -150,7 +150,7 @@ static TCHAR* InitXStatusIconLibrary(TCHAR *buf, size_t buf_size) null_strcpy(buf, path, buf_size - 1);
char ident[MAX_PATH];
- if ( LoadStringA(hXStatusIconsDLL, IDS_IDENTIFY, ident, sizeof(ident)) == 0 || strcmpnull(ident, "# Custom Status Icons #"))
+ if ( LoadStringA(hXStatusIconsDLL, IDS_IDENTIFY, ident, sizeof(ident)) == 0 || mir_strcmp(ident, "# Custom Status Icons #"))
*buf = 0;
FreeLibrary(hXStatusIconsDLL);
@@ -419,7 +419,7 @@ void CIcqProto::handleXStatusCaps(DWORD dwUIN, char *szUID, MCONTACT hContact, B if (moodXStatus[i] == -1) continue;
mir_snprintf(szMoodId, SIZEOF(szMoodId), "0icqmood%d", moodXStatus[i]);
- if ( !strcmpnull(szMoodId, szMoodData)) {
+ if (!mir_strcmp(szMoodId, szMoodData)) {
BYTE bXStatusId = (BYTE)(i+1);
char str[MAX_PATH];
diff --git a/protocols/IcqOscarJ/src/icq_xtraz.cpp b/protocols/IcqOscarJ/src/icq_xtraz.cpp index bbd5eb7146..ebcb150adc 100644 --- a/protocols/IcqOscarJ/src/icq_xtraz.cpp +++ b/protocols/IcqOscarJ/src/icq_xtraz.cpp @@ -62,7 +62,7 @@ void CIcqProto::handleXtrazNotify(DWORD dwUin, DWORD dwMID, DWORD dwMID2, WORD w szWork += 10;
*szEnd = '\0';
- if (!stricmpnull(szWork, "srvMng") && strstrnull(szNotify, "AwayStat")) {
+ if (!mir_strcmpi(szWork, "srvMng") && strstrnull(szNotify, "AwayStat")) {
char *szSender = strstrnull(szNotify, "<senderId>");
char *szEndSend = strstrnull(szNotify, "</senderId>");
@@ -200,7 +200,7 @@ void CIcqProto::handleXtrazNotifyResponse(MCONTACT hContact, WORD wCookie, char* szNode += 13; //one more than the length of the string to skip ' or " too
szWork = szEnd + 1;
- if (!stricmpnull(szNode, "cAwaySrv")) {
+ if (!mir_strcmpi(szNode, "cAwaySrv")) {
int bChanged = FALSE;
*szEnd = ' ';
@@ -223,7 +223,7 @@ void CIcqProto::handleXtrazNotifyResponse(MCONTACT hContact, WORD wCookie, char* szXName = DemangleXml(szNode, mir_strlen(szNode));
// check if the name changed
szOldXName = getSettingStringUtf(hContact, DBSETTING_XSTATUS_NAME, NULL);
- if (strcmpnull(szOldXName, szXName))
+ if (mir_strcmp(szOldXName, szXName))
bChanged = TRUE;
SAFE_FREE(&szOldXName);
db_set_utf(hContact, m_szModuleName, DBSETTING_XSTATUS_NAME, szXName);
@@ -239,7 +239,7 @@ void CIcqProto::handleXtrazNotifyResponse(MCONTACT hContact, WORD wCookie, char* szXMsg = DemangleXml(szNode, mir_strlen(szNode));
// check if the decription changed
szOldXMsg = getSettingStringUtf(hContact, DBSETTING_XSTATUS_NAME, NULL);
- if (strcmpnull(szOldXMsg, szXMsg))
+ if (mir_strcmp(szOldXMsg, szXMsg))
bChanged = TRUE;
SAFE_FREE(&szOldXMsg);
db_set_utf(hContact, m_szModuleName, DBSETTING_XSTATUS_MSG, szXMsg);
@@ -285,7 +285,7 @@ void CIcqProto::handleXtrazInvitation(DWORD dwUin, char* szMsg, BOOL bThruDC) SetContactCapabilities(hContact, CAPF_XTRAZ);
char *szPluginID = getXmlPidItem(szMsg);
- if (!strcmpnull(szPluginID, "ICQChatRecv")) // it is a invitation to multi-user chat
+ if (!mir_strcmp(szPluginID, "ICQChatRecv")) // it is a invitation to multi-user chat
;
else
NetLog_Uni(bThruDC, "Error: Unknown plugin \"%s\" in Xtraz message", szPluginID);
@@ -301,7 +301,7 @@ void CIcqProto::handleXtrazData(DWORD dwUin, char* szMsg, BOOL bThruDC) SetContactCapabilities(hContact, CAPF_XTRAZ);
char *szPluginID = getXmlPidItem(szMsg);
- if (!strcmpnull(szPluginID, "viewCard")) { // it is a greeting card
+ if (!mir_strcmp(szPluginID, "viewCard")) { // it is a greeting card
char *szWork, *szEnd, *szUrl, *szNum;
szWork = strstrnull(szMsg, "<InD>");
diff --git a/protocols/IcqOscarJ/src/icqosc_svcs.cpp b/protocols/IcqOscarJ/src/icqosc_svcs.cpp index 4c325a7b6e..4e79e71618 100644 --- a/protocols/IcqOscarJ/src/icqosc_svcs.cpp +++ b/protocols/IcqOscarJ/src/icqosc_svcs.cpp @@ -124,26 +124,26 @@ INT_PTR CIcqProto::GetInfoSetting(WPARAM hContact, LPARAM lParam) cgs->pValue->type = type;
}
- else if (!strcmpnull(cgs->szModule, m_szModuleName) && (dbv.type == DBVT_BYTE || dbv.type == DBVT_WORD || dbv.type == DBVT_DWORD)) {
+ else if (!mir_strcmp(cgs->szModule, m_szModuleName) && (dbv.type == DBVT_BYTE || dbv.type == DBVT_WORD || dbv.type == DBVT_DWORD)) {
int code = (dbv.type == DBVT_BYTE) ? dbv.bVal : ((dbv.type == DBVT_WORD) ? dbv.wVal : dbv.dVal);
- if (!strcmpnull(cgs->szSetting, "Language1") || !strcmpnull(cgs->szSetting, "Language2") || !strcmpnull(cgs->szSetting, "Language3"))
+ if (!mir_strcmp(cgs->szSetting, "Language1") || !mir_strcmp(cgs->szSetting, "Language2") || !mir_strcmp(cgs->szSetting, "Language3"))
rc = LookupDatabaseSetting(languageField, code, cgs->pValue, type);
- else if (!strcmpnull(cgs->szSetting, "Country") || !strcmpnull(cgs->szSetting, "OriginCountry") || !strcmpnull(cgs->szSetting, "CompanyCountry")) {
+ else if (!mir_strcmp(cgs->szSetting, "Country") || !mir_strcmp(cgs->szSetting, "OriginCountry") || !mir_strcmp(cgs->szSetting, "CompanyCountry")) {
if (code == 420) code = 42; // conversion of obsolete codes (OMG!)
else if (code == 421) code = 4201;
else if (code == 102) code = 1201;
rc = LookupDatabaseSetting(countryField, code, cgs->pValue, type);
}
- else if (!strcmpnull(cgs->szSetting, "Gender"))
+ else if (!mir_strcmp(cgs->szSetting, "Gender"))
rc = LookupDatabaseSetting(genderField, code, cgs->pValue, type);
- else if (!strcmpnull(cgs->szSetting, "MaritalStatus"))
+ else if (!mir_strcmp(cgs->szSetting, "MaritalStatus"))
rc = LookupDatabaseSetting(maritalField, code, cgs->pValue, type);
- else if (!strcmpnull(cgs->szSetting, "StudyLevel"))
+ else if (!mir_strcmp(cgs->szSetting, "StudyLevel"))
rc = LookupDatabaseSetting(studyLevelField, code, cgs->pValue, type);
- else if (!strcmpnull(cgs->szSetting, "CompanyIndustry"))
+ else if (!mir_strcmp(cgs->szSetting, "CompanyIndustry"))
rc = LookupDatabaseSetting(industryField, code, cgs->pValue, type);
- else if (!strcmpnull(cgs->szSetting, "Interest0Cat") || !strcmpnull(cgs->szSetting, "Interest1Cat") || !strcmpnull(cgs->szSetting, "Interest2Cat") || !strcmpnull(cgs->szSetting, "Interest3Cat"))
+ else if (!mir_strcmp(cgs->szSetting, "Interest0Cat") || !mir_strcmp(cgs->szSetting, "Interest1Cat") || !mir_strcmp(cgs->szSetting, "Interest2Cat") || !mir_strcmp(cgs->szSetting, "Interest3Cat"))
rc = LookupDatabaseSetting(interestsField, code, cgs->pValue, type);
}
// Release database memory
@@ -444,7 +444,7 @@ INT_PTR CIcqProto::RevokeAuthorization(WPARAM wParam, LPARAM) if (MessageBox(NULL, TranslateT("Are you sure you want to revoke user's authorization?\nThis will remove you from his/her list on some clients."), TranslateT("Confirmation"), MB_ICONQUESTION | MB_YESNO) != IDYES)
return 0;
-
+
icq_sendRevokeAuthServ(dwUin, szUid);
}
diff --git a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp index 8ac157c740..ddcb9efda3 100644 --- a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp +++ b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp @@ -695,9 +695,9 @@ static char* oftGetFileContainer(oscar_filetransfer* oft, const char** files, in // try to find existing container
for (i = 0; i < oft->containerCount; i++)
- if (!strcmpnull(szPathUtf, oft->file_containers[i])) {
- SAFE_FREE((void**)&szPathUtf);
- return oft->file_containers[i];
+ if (!mir_strcmp(szPathUtf, oft->file_containers[i])) {
+ SAFE_FREE((void**)&szPathUtf);
+ return oft->file_containers[i];
}
// create new container
diff --git a/protocols/IcqOscarJ/src/stdpackets.cpp b/protocols/IcqOscarJ/src/stdpackets.cpp index dcda61cc90..0e2c2554c6 100644 --- a/protocols/IcqOscarJ/src/stdpackets.cpp +++ b/protocols/IcqOscarJ/src/stdpackets.cpp @@ -240,7 +240,7 @@ void CIcqProto::icq_setstatus(WORD wStatus, const char *szStatusNote) size_t wStatusMoodLen = 0, wStatusNoteLen = 0, wSessionDataLen = 0;
char *szMoodData = NULL;
- if (szStatusNote && strcmpnull(szCurrentStatusNote, szStatusNote)) { // status note was changed, update now
+ if (szStatusNote && mir_strcmp(szCurrentStatusNote, szStatusNote)) { // status note was changed, update now
DBVARIANT dbv = { DBVT_DELETED };
if (m_bMoodsEnabled && !getString(DBSETTING_STATUS_MOOD, &dbv))
szMoodData = null_strdup(dbv.pszVal);
diff --git a/protocols/IcqOscarJ/src/upload.cpp b/protocols/IcqOscarJ/src/upload.cpp index 2f65194773..46bccc228b 100644 --- a/protocols/IcqOscarJ/src/upload.cpp +++ b/protocols/IcqOscarJ/src/upload.cpp @@ -32,7 +32,7 @@ int CIcqProto::StringToListItemId(const char *szSetting,int def) int i;
for(i=0;i<settingCount;i++)
- if (!strcmpnull(szSetting,setting[i].szDbSetting))
+ if (!mir_strcmp(szSetting,setting[i].szDbSetting))
break;
if (i == settingCount)
@@ -45,7 +45,7 @@ int CIcqProto::StringToListItemId(const char *szSetting,int def) return def;
for (i=0; list[i].text; i++)
- if (!strcmpnull(list[i].text, szValue))
+ if (!mir_strcmp(list[i].text, szValue))
break;
SAFE_FREE(&szValue);
@@ -67,7 +67,7 @@ int ChangeInfoData::UploadSettings(void) //password
char* tmp = ppro->GetUserPassword(TRUE);
if (tmp) {
- if (mir_strlen(Password) > 0 && strcmpnull(Password, tmp)) {
+ if (mir_strlen(Password) > 0 && mir_strcmp(Password, tmp)) {
// update password in user info dialog (still open)
strcpy(Password, tmp);
// update password in protocol
diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp index 9e2298aa90..3a5974df1a 100644 --- a/protocols/IcqOscarJ/src/utilities.cpp +++ b/protocols/IcqOscarJ/src/utilities.cpp @@ -499,8 +499,8 @@ MCONTACT CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added) DWORD dwContactUin;
uid_str szContactUid;
if (!getContactUid(hContact, &dwContactUin, &szContactUid)) {
- if (!dwContactUin && !stricmpnull(szContactUid, szUid)) {
- if (strcmpnull(szContactUid, szUid)) // fix case in SN
+ if (!dwContactUin && !mir_strcmpi(szContactUid, szUid)) {
+ if (mir_strcmp(szContactUid, szUid)) // fix case in SN
setString(hContact, UNIQUEIDSETTING, szUid);
return hContact;
@@ -550,7 +550,7 @@ MCONTACT CIcqProto::HContactFromAuthEvent(MEVENT hEvent) if (dbei.eventType != EVENTTYPE_AUTHREQUEST)
return INVALID_CONTACT_ID;
- if (strcmpnull(dbei.szModule, m_szModuleName))
+ if (mir_strcmp(dbei.szModule, m_szModuleName))
return INVALID_CONTACT_ID;
return DbGetAuthEventContact(&dbei);
@@ -580,31 +580,6 @@ char* strUID(DWORD dwUIN, char *pszUID) return pszUID;
}
-
-/* a mir_strcmp() that likes NULL */
-int __fastcall strcmpnull(const char *str1, const char *str2)
-{
- if (str1 && str2)
- return mir_strcmp(str1, str2);
-
- if (!str1 && !str2)
- return 0;
-
- return 1;
-}
-
-/* a mir_strcmpi() that likes NULL */
-int __fastcall stricmpnull(const char *str1, const char *str2)
-{
- if (str1 && str2)
- return _stricmp(str1, str2);
-
- if (!str1 && !str2)
- return 0;
-
- return 1;
-}
-
char* __fastcall strstrnull(const char *str, const char *substr)
{
if (str)
@@ -1085,7 +1060,7 @@ void __cdecl CIcqProto::SetStatusNoteThread(void *pDelay) if (m_bMoodsEnabled && !setStatusMoodData && szCurrentStatusMood)
setStatusMoodData = null_strdup(szCurrentStatusMood);
- if (strcmpnull(szCurrentStatusNote, setStatusNoteText) || (m_bMoodsEnabled && strcmpnull(szCurrentStatusMood, setStatusMoodData))) {
+ if (mir_strcmp(szCurrentStatusNote, setStatusNoteText) || (m_bMoodsEnabled && mir_strcmp(szCurrentStatusMood, setStatusMoodData))) {
db_set_utf(NULL, m_szModuleName, DBSETTING_STATUS_NOTE, setStatusNoteText);
if (m_bMoodsEnabled)
setString(DBSETTING_STATUS_MOOD, setStatusMoodData);
@@ -1139,7 +1114,7 @@ int CIcqProto::SetStatusNote(const char *szStatusNote, DWORD dwDelay, int bForce if (!setStatusNoteText && (!m_bMoodsEnabled || !setStatusMoodData)) { // check if the status note was changed and if yes, create thread to change it
char *szCurrentStatusNote = getSettingStringUtf(NULL, DBSETTING_STATUS_NOTE, NULL);
- if (strcmpnull(szCurrentStatusNote, szStatusNote)) { // status note was changed
+ if (mir_strcmp(szCurrentStatusNote, szStatusNote)) { // status note was changed
// create thread to change status note on existing server connection
setStatusNoteText = null_strdup(szStatusNote);
@@ -1179,7 +1154,7 @@ int CIcqProto::SetStatusMood(const char *szMoodData, DWORD dwDelay) if (!getString(DBSETTING_STATUS_MOOD, &dbv))
szCurrentStatusMood = dbv.pszVal;
- if (strcmpnull(szCurrentStatusMood, szMoodData)) { // status mood was changed
+ if (mir_strcmp(szCurrentStatusMood, szMoodData)) { // status mood was changed
// create thread to change status mood on existing server connection
setStatusMoodData = null_strdup(szMoodData);
if (dwDelay)
diff --git a/protocols/IcqOscarJ/src/utilities.h b/protocols/IcqOscarJ/src/utilities.h index 8b12897596..c807a804c3 100644 --- a/protocols/IcqOscarJ/src/utilities.h +++ b/protocols/IcqOscarJ/src/utilities.h @@ -65,8 +65,6 @@ char *NickFromHandle(MCONTACT hContact); char *NickFromHandleUtf(MCONTACT hContact);
char *strUID(DWORD dwUIN, char *pszUID);
-int __fastcall strcmpnull(const char *str1, const char *str2);
-int __fastcall stricmpnull(const char *str1, const char *str2);
char* __fastcall strstrnull(const char *str, const char *substr);
char* __fastcall null_strdup(const char *string);
char* __fastcall null_strcpy(char *dest, const char *src, size_t maxlen);
|