summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src/chat/manager.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-07-06 12:10:42 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-07-06 12:10:42 +0000
commit3480ee282427850ceaee9ab38887b66c396cbf67 (patch)
tree9ae6d69ff176f0168a392546118ddf7769478561 /plugins/TabSRMM/src/chat/manager.cpp
parentecbda9bae58700987dcb77730f54dfc37b3ff9c5 (diff)
tabSRMM: code cleaning for chat fonts/colors
git-svn-id: http://svn.miranda-ng.org/main/trunk@5243 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/src/chat/manager.cpp')
-rw-r--r--plugins/TabSRMM/src/chat/manager.cpp40
1 files changed, 21 insertions, 19 deletions
diff --git a/plugins/TabSRMM/src/chat/manager.cpp b/plugins/TabSRMM/src/chat/manager.cpp
index f87b52962a..3b3c58d72f 100644
--- a/plugins/TabSRMM/src/chat/manager.cpp
+++ b/plugins/TabSRMM/src/chat/manager.cpp
@@ -313,9 +313,9 @@ BOOL SM_AddEvent(const TCHAR* pszID, const char* pszModule, GCEVENT * gce, BOOL
li->ptszStatus = mir_tstrdup(gce->ptszStatus);
li->ptszUserInfo = mir_tstrdup(gce->ptszUserInfo);
- li->bIsMe = gce->bIsMe;
+ li->bIsMe = gce->bIsMe != 0;
+ li->bIsHighlighted = bIsHighlighted != 0;
li->time = gce->time;
- li->bIsHighlighted = bIsHighlighted;
if (g_Settings.iEventLimit > 0 && pTemp->iEventCount > g_Settings.iEventLimit + g_Settings.iEventLimitThreshold) {
LM_TrimLog(&pTemp->pLog, &pTemp->pLogEnd, pTemp->iEventCount - g_Settings.iEventLimit);
@@ -1363,28 +1363,30 @@ USERINFO* UM_SetContactStatus(USERINFO* pUserList, const TCHAR* pszUID, WORD sta
BOOL UM_SetStatusEx(USERINFO* pUserList, const TCHAR* pszText, int flags)
{
- USERINFO *pTemp = pUserList, *pLast = NULL;
- int bOnlyMe = (flags & GC_SSE_ONLYLISTED) != 0, bSetStatus = (flags & GC_SSE_ONLINE) != 0;
+ bool bOnlyMe = (flags & GC_SSE_ONLYLISTED) != 0, bAwaySetStatus = (flags & GC_SSE_ONLINE) != 0, bOfflineSetStatus = (flags & GC_SSE_OFFLINE) != 0;
char cDelimiter = (flags & GC_SSE_TABDELIMITED) ? '\t' : ' ';
- while (pTemp != NULL) {
+ for (USERINFO *p = pUserList; p != NULL; p = p->next) {
if (!bOnlyMe)
- pTemp->iStatusEx = 0;
-
- if (pszText != NULL) {
- TCHAR* s = (TCHAR *)_tcsstr(pszText, pTemp->pszUID);
- if (s) {
- pTemp->iStatusEx = 0;
- if (s == pszText || s[-1] == cDelimiter) {
- int len = lstrlen(pTemp->pszUID);
- if (s[len] == cDelimiter || s[len] == '\0')
- pTemp->iStatusEx = (!bOnlyMe || bSetStatus) ? 1 : 0;
- }
+ p->iStatusEx = CHAT_STATUS_NORMAL;
+
+ if (pszText == NULL)
+ continue;
+
+ TCHAR* s = (TCHAR *)_tcsstr(pszText, p->pszUID);
+ if (s == NULL)
+ continue;
+
+ p->iStatusEx = CHAT_STATUS_NORMAL;
+ if (s == pszText || s[-1] == cDelimiter) {
+ int len = lstrlen(p->pszUID);
+ if (s[len] == cDelimiter || s[len] == '\0') {
+ if (!bOnlyMe || bAwaySetStatus)
+ p->iStatusEx = CHAT_STATUS_AWAY;
+ else if (bOfflineSetStatus)
+ p->iStatusEx = CHAT_STATUS_OFFLINE;
}
}
-
- pLast = pTemp;
- pTemp = pTemp->next;
}
return TRUE;
}