From 1f8a4e09b94c4cd9764b5f081e5a911b847bb5a8 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Sun, 23 Feb 2014 21:49:15 +0000 Subject: 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 --- plugins/Clist_nicer/src/clcitems.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'plugins/Clist_nicer') 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 ); -- cgit v1.2.3