summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-03-13 22:25:26 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-03-13 22:25:26 +0300
commit1202cf04c667c72fb30bd01608585283b9cc1914 (patch)
treef48627e3269cbde16d08d8ac37359647141f6e59 /plugins
parent25c7aab043ce803362898d211319ebac4474af4e (diff)
chat engine:
- fixes #1174 (Group chat icons became "blank exe" icons if role cound exceeds 10); - unused chat api members removed;
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Scriver/src/chat_manager.cpp23
-rw-r--r--plugins/TabSRMM/src/chat_tools.cpp6
2 files changed, 10 insertions, 19 deletions
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;
}