summaryrefslogtreecommitdiff
path: root/src/modules/chat/chat_svc.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-01-18 09:34:05 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-01-18 09:34:05 +0000
commit04ac06b7119933997ee0b407478d4cb409007098 (patch)
tree7fd4cdc723f4d38a2bc42230062bddb1445ac5f0 /src/modules/chat/chat_svc.cpp
parent69ee782255e915d282f17cf702eff574fb82e84a (diff)
end of crazy matrix mechanics in chat's icon ordering
git-svn-id: http://svn.miranda-ng.org/main/trunk@7708 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/chat/chat_svc.cpp')
-rw-r--r--src/modules/chat/chat_svc.cpp17
1 files changed, 14 insertions, 3 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;