summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/chat/chat_svc.cpp17
-rw-r--r--src/modules/chat/manager.cpp18
2 files changed, 17 insertions, 18 deletions
diff --git a/src/modules/chat/chat_svc.cpp b/src/modules/chat/chat_svc.cpp
index bfb928ce11..7aefea1e20 100644
--- a/src/modules/chat/chat_svc.cpp
+++ b/src/modules/chat/chat_svc.cpp
@@ -175,7 +175,7 @@ static INT_PTR Service_Register(WPARAM wParam, LPARAM lParam)
memcpy(mi->crColors, gcr->pColors, sizeof(COLORREF)* gcr->nColors);
}
- mi->pszHeader = Log_CreateRtfHeader(mi);
+ mi->pszHeader = ci.Log_CreateRtfHeader(mi);
CheckColorsInModule((char*)gcr->pszModule);
ci.SetAllOffline(TRUE, gcr->pszModule);
@@ -248,6 +248,17 @@ static INT_PTR Service_NewChat(WPARAM wParam, LPARAM lParam)
return 0;
}
+static void SetInitDone(SESSION_INFO *si)
+{
+ if (si->bInitDone)
+ return;
+
+ si->bInitDone = true;
+ for (STATUSINFO *p = si->pStatuses; p; p = p->next)
+ if ((UINT_PTR)p->hIcon < STATUSICONCOUNT)
+ p->hIcon = HICON(si->iStatusCount - (int)p->hIcon - 1);
+}
+
static int DoControl(GCEVENT *gce, WPARAM wp)
{
SESSION_INFO *si;
@@ -256,7 +267,7 @@ static int DoControl(GCEVENT *gce, WPARAM wp)
switch (wp) {
case WINDOW_HIDDEN:
if (si = ci.SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule)) {
- si->bInitDone = TRUE;
+ SetInitDone(si);
ci.SetActiveSession(si->ptszID, si->pszModule);
if (si->hWnd)
ci.ShowRoom(si, wp, FALSE);
@@ -268,7 +279,7 @@ static int DoControl(GCEVENT *gce, WPARAM wp)
case WINDOW_VISIBLE:
case SESSION_INITDONE:
if (si = ci.SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule)) {
- si->bInitDone = TRUE;
+ SetInitDone(si);
if (wp != SESSION_INITDONE || db_get_b(NULL, "Chat", "PopupOnJoin", 0) == 0)
ci.ShowRoom(si, wp, TRUE);
return 0;
diff --git a/src/modules/chat/manager.cpp b/src/modules/chat/manager.cpp
index 6c7b1c6afa..d418b56a24 100644
--- a/src/modules/chat/manager.cpp
+++ b/src/modules/chat/manager.cpp
@@ -226,22 +226,10 @@ static HICON SM_GetStatusIcon(SESSION_INFO *si, USERINFO * ui)
STATUSINFO *ti = ci.TM_FindStatus(si->pStatuses, ci.TM_WordToString(si->pStatuses, ui->Status));
if (ti != NULL) {
- if ((INT_PTR)ti->hIcon >= STATUSICONCOUNT)
+ if ((UINT_PTR)ti->hIcon >= STATUSICONCOUNT)
return ti->hIcon;
- int id = si->iStatusCount - (int)ti->hIcon - 1;
- if (id == 0)
- return ci.hIcons[ICON_STATUS0];
- if (id == 1)
- return ci.hIcons[ICON_STATUS1];
- if (id == 2)
- return ci.hIcons[ICON_STATUS2];
- if (id == 3)
- return ci.hIcons[ICON_STATUS3];
- if (id == 4)
- return ci.hIcons[ICON_STATUS4];
- if (id == 5)
- return ci.hIcons[ICON_STATUS5];
+ return ci.hIcons[ICON_STATUS0 + (int)ti->hIcon];
}
return ci.hIcons[ICON_STATUS0];
}
@@ -898,7 +886,7 @@ static void MM_FontsChanged(void)
{
MODULEINFO *pTemp = m_ModList;
while (pTemp != NULL) {
- pTemp->pszHeader = Log_CreateRtfHeader(pTemp);
+ pTemp->pszHeader = ci.Log_CreateRtfHeader(pTemp);
pTemp = pTemp->next;
}
return;