summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-04-14 17:13:05 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-04-14 17:13:05 +0000
commit1681b4828192e02e34c74a65387562a8b2215faa (patch)
tree5b9a60b80eabdd7a873b75cc5d78240bf403f69f /protocols/IcqOscarJ/src
parent4c0a9cfe95004f1fc934b69aa65cf2bd8a3f46ac (diff)
some minor problems in ICQ
git-svn-id: http://svn.miranda-ng.org/main/trunk@12821 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ/src')
-rw-r--r--protocols/IcqOscarJ/src/UI/userinfotab.cpp11
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.cpp8
-rw-r--r--protocols/IcqOscarJ/src/oscar_filetransfer.cpp4
3 files changed, 11 insertions, 12 deletions
diff --git a/protocols/IcqOscarJ/src/UI/userinfotab.cpp b/protocols/IcqOscarJ/src/UI/userinfotab.cpp
index bc10bc47da..bbd19d4793 100644
--- a/protocols/IcqOscarJ/src/UI/userinfotab.cpp
+++ b/protocols/IcqOscarJ/src/UI/userinfotab.cpp
@@ -106,19 +106,18 @@ static void SetValue(CIcqProto* ppro, HWND hwndDlg, int idCtrl, MCONTACT hContac
unspecified = 1;
}
else if (special == SVS_STATUSID) {
- char *pXName;
char *pszStatus = MirandaStatusToStringUtf(dbv.wVal);
BYTE bXStatus = ppro->getContactXStatus(hContact);
if (bXStatus) {
- pXName = ppro->getSettingStringUtf(hContact, DBSETTING_XSTATUS_NAME, NULL);
- if (!mir_strlen(pXName)) { // give default name
+ char *pXName = ppro->getSettingStringUtf(hContact, DBSETTING_XSTATUS_NAME, NULL);
+ if (pXName == NULL) // give default name
pXName = ICQTranslateUtf(nameXStatus[bXStatus - 1]);
- }
+
mir_snprintf(str, SIZEOF(str), "%s (%s)", pszStatus, pXName);
SAFE_FREE((void**)&pXName);
- } else
- strncpy_s(str, pszStatus, _TRUNCATE);
+ }
+ else strncpy_s(str, pszStatus, _TRUNCATE);
bUtf = 1;
SAFE_FREE(&pszStatus);
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp
index c811a77704..1e4289a9f4 100644
--- a/protocols/IcqOscarJ/src/icq_proto.cpp
+++ b/protocols/IcqOscarJ/src/icq_proto.cpp
@@ -1531,9 +1531,10 @@ char* CIcqProto::PrepareStatusNote(int nStatus)
// use custom status message as status note
if (bXStatus)
- szStatusNote = getSettingStringUtf(NULL, DBSETTING_XSTATUS_MSG, "");
+ szStatusNote = getSettingStringUtf(NULL, DBSETTING_XSTATUS_MSG, NULL);
- if (!szStatusNote || !szStatusNote[0]) { // get standard status message (no custom status defined)
+ // get standard status message (no custom status defined)
+ if (szStatusNote == NULL) {
mir_cslock l(m_modeMsgsMutex);
char **pszStatusNote = MirandaStatusToAwayMsg(nStatus);
@@ -1541,8 +1542,7 @@ char* CIcqProto::PrepareStatusNote(int nStatus)
szStatusNote = null_strdup(*pszStatusNote);
}
- if (!szStatusNote)
- // nothing available set empty status note
+ if (szStatusNote == NULL) // nothing available. set empty status note
szStatusNote = null_strdup("");
return szStatusNote;
diff --git a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp
index 8cc8e10d5a..adde56ad16 100644
--- a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp
+++ b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp
@@ -386,8 +386,8 @@ void CIcqProto::handleRecvServMsgOFT(BYTE *buf, size_t wLen, DWORD dwUin, char *
null_strcpy(szEnc, (char*)charset->pData, charset->wLen);
str = ApplyEncoding((char*)pszDescription, szEnc);
}
- else
- str = null_strdup(str);
+ else str = null_strdup(str);
+
// eliminate HTML tags
pszDescription = EliminateHtml(str, mir_strlen(str));