summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-08-16 12:19:53 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-08-16 12:20:01 +0300
commitea322d5c50ebfc21df05ced2b592e8ce16115623 (patch)
treef5b0f131e11f09f09758714a5fcbeafa0b593866 /src/mir_app
parentb23289e53f35de85f9a6f048aa1b8a27c6bd2404 (diff)
fixes #880 (IRC dims all rooms after leaving one)
Diffstat (limited to 'src/mir_app')
-rw-r--r--src/mir_app/src/chat_svc.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mir_app/src/chat_svc.cpp b/src/mir_app/src/chat_svc.cpp
index e2efeee255..1de51605e6 100644
--- a/src/mir_app/src/chat_svc.cpp
+++ b/src/mir_app/src/chat_svc.cpp
@@ -287,6 +287,7 @@ static INT_PTR __stdcall stubRoomControl(void *param)
case WINDOW_HIDDEN:
if (si == nullptr)
return GC_EVENT_ERROR;
+
SetInitDone(si);
chatApi.SetActiveSession(si);
break;
@@ -295,12 +296,16 @@ static INT_PTR __stdcall stubRoomControl(void *param)
case SESSION_INITDONE:
if (si == nullptr)
return GC_EVENT_ERROR;
+
SetInitDone(si);
if (p->command != SESSION_INITDONE || db_get_b(0, CHAT_MODULE, "PopupOnJoin", 0) == 0)
chatApi.ShowRoom(si);
break;
case SESSION_OFFLINE:
+ if (si == nullptr && p->wszId != nullptr)
+ return GC_EVENT_ERROR;
+
SM_SetOffline(p->szModule, si);
SM_SetStatus(p->szModule, si, ID_STATUS_OFFLINE);
if (si && si->pDlg) {
@@ -310,6 +315,9 @@ static INT_PTR __stdcall stubRoomControl(void *param)
break;
case SESSION_ONLINE:
+ if (si == nullptr && p->wszId != nullptr)
+ return GC_EVENT_ERROR;
+
SM_SetStatus(p->szModule, si, ID_STATUS_ONLINE);
if (si && si->pDlg)
si->pDlg->UpdateStatusBar();
@@ -318,6 +326,7 @@ static INT_PTR __stdcall stubRoomControl(void *param)
case WINDOW_CLEARLOG:
if (si == nullptr)
return GC_EVENT_ERROR;
+
chatApi.LM_RemoveAll(&si->pLog, &si->pLogEnd);
si->iEventCount = 0;
si->LastTime = 0;