From 1202cf04c667c72fb30bd01608585283b9cc1914 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 13 Mar 2018 22:25:26 +0300 Subject: chat engine: - fixes #1174 (Group chat icons became "blank exe" icons if role cound exceeds 10); - unused chat api members removed; --- plugins/Scriver/src/chat_manager.cpp | 23 +++++++---------------- plugins/TabSRMM/src/chat_tools.cpp | 6 +++--- 2 files changed, 10 insertions(+), 19 deletions(-) (limited to 'plugins') diff --git a/plugins/Scriver/src/chat_manager.cpp b/plugins/Scriver/src/chat_manager.cpp index 0995b28b74..0bfadfeb7e 100644 --- a/plugins/Scriver/src/chat_manager.cpp +++ b/plugins/Scriver/src/chat_manager.cpp @@ -52,23 +52,14 @@ char SM_GetStatusIndicator(SESSION_INFO *si, USERINFO *ui) STATUSINFO *ti = pci->TM_FindStatus(si->pStatuses, pci->TM_WordToString(si->pStatuses, ui->Status)); if (ti) { - if ((INT_PTR)ti->hIcon < STATUSICONCOUNT) { - INT_PTR id = si->iStatusCount - (INT_PTR)ti->hIcon - 1; - if (id == 0) - return '\0'; - if (id == 1) - return '+'; - if (id == 2) - return '%'; - if (id == 3) - return '@'; - if (id == 4) - return '!'; - if (id == 5) - return '*'; + switch (si->iStatusCount - ti->iIconIndex - 1) { + case 0: return '\0'; + case 1: return '+'; + case 2: return '%'; + case 3: return '@'; + case 4: return '!'; + case 5: return '*'; } - else - return '\0'; } return '\0'; } diff --git a/plugins/TabSRMM/src/chat_tools.cpp b/plugins/TabSRMM/src/chat_tools.cpp index bde0070409..333b857f17 100644 --- a/plugins/TabSRMM/src/chat_tools.cpp +++ b/plugins/TabSRMM/src/chat_tools.cpp @@ -538,10 +538,10 @@ char GetIndicator(SESSION_INFO *si, LPCTSTR ptszNick, int *iNickIndex) for (USERINFO *ui = si->pUsers; ui; ui = ui->next) { if (!mir_wstrcmp(ui->pszNick, ptszNick)) { STATUSINFO *ti = pci->TM_FindStatus(si->pStatuses, pci->TM_WordToString(si->pStatuses, ui->Status)); - if (ti && (INT_PTR)ti->hIcon < si->iStatusCount) { + if (ti) { if (iNickIndex) - *iNickIndex = (INT_PTR)ti->hIcon; // color table's index is not zero-based - return szIndicators[(INT_PTR)ti->hIcon]; + *iNickIndex = ti->iIconIndex; // color table's index is not zero-based + return szIndicators[ti->iIconIndex]; } break; } -- cgit v1.2.3