diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2014-02-23 21:49:15 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2014-02-23 21:49:15 +0000 |
commit | 1f8a4e09b94c4cd9764b5f081e5a911b847bb5a8 (patch) | |
tree | 9c8d4ea5ff97bc55febf903a830a5f5fe59708a5 /plugins/Clist_nicer/src/clcitems.cpp | |
parent | 32370a4b610d51bc033377e386482fab1ce01af1 (diff) |
clist nicer now displays status messages with at least one character instead of two (fixes #597)
git-svn-id: http://svn.miranda-ng.org/main/trunk@8242 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_nicer/src/clcitems.cpp')
-rw-r--r-- | plugins/Clist_nicer/src/clcitems.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index fc994cb0bc..f6f42bbb47 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -222,16 +222,15 @@ void RebuildEntireList(HWND hwnd, struct ClcData *dat) BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto)
{
- DBVARIANT dbv = {0};
-
if (p == NULL)
return 0;
p->bStatusMsgValid = STATUSMSG_NOTFOUND;
MCONTACT hContact = p->hContact;
- int result = cfg::getTString(hContact, "CList", "StatusMsg", &dbv);
- if ( !result && lstrlen(dbv.ptszVal) > 1)
+ DBVARIANT dbv = {0};
+ INT_PTR result = cfg::getTString(hContact, "CList", "StatusMsg", &dbv);
+ if ( !result && lstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_CLIST;
else {
if ( !szProto)
@@ -239,11 +238,11 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) if (szProto) {
if ( !result )
db_free( &dbv );
- if ( !( result = cfg::getTString(hContact, szProto, "YMsg", &dbv)) && lstrlen(dbv.ptszVal) > 1)
+ if ( !( result = cfg::getTString(hContact, szProto, "YMsg", &dbv)) && lstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_YIM;
- else if ( !(result = cfg::getTString(hContact, szProto, "StatusDescr", &dbv)) && lstrlen(dbv.ptszVal) > 1)
+ else if ( !(result = cfg::getTString(hContact, szProto, "StatusDescr", &dbv)) && lstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_GG;
- else if ( !(result = cfg::getTString(hContact, szProto, "XStatusMsg", &dbv)) && lstrlen(dbv.ptszVal) > 1)
+ else if ( !(result = cfg::getTString(hContact, szProto, "XStatusMsg", &dbv)) && lstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_XSTATUS;
}
}
@@ -281,15 +280,15 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) }
if (p->bStatusMsgValid > STATUSMSG_XSTATUSNAME) {
- int j = 0, i;
+ int j = 0;
p->statusMsg = (TCHAR *)realloc(p->statusMsg, (lstrlen(dbv.ptszVal) + 2) * sizeof(TCHAR));
- for (i = 0; dbv.ptszVal[i]; i++) {
+ for (int i = 0; dbv.ptszVal[i]; i++) {
if (dbv.ptszVal[i] == (TCHAR)0x0d)
continue;
p->statusMsg[j] = dbv.ptszVal[i] == (wchar_t)0x0a ? (wchar_t)' ' : dbv.ptszVal[i];
j++;
}
- p->statusMsg[j] = (TCHAR)0;
+ p->statusMsg[j] = 0;
}
if ( !result )
db_free( &dbv );
|