From c7b17549ed7029682d9012d3d53d3e34523f699f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 22 Feb 2017 19:49:37 +0300 Subject: Discord: - support for channel creation & destruction on the fly - code cleaning --- src/mir_app/src/chat_svc.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mir_app/src/chat_svc.cpp b/src/mir_app/src/chat_svc.cpp index a3412dadd5..c7d2eab119 100644 --- a/src/mir_app/src/chat_svc.cpp +++ b/src/mir_app/src/chat_svc.cpp @@ -672,8 +672,12 @@ MIR_APP_DLL(int) Chat_SendUserMessage(const char *szModule, const wchar_t *wszId MIR_APP_DLL(int) Chat_SetStatusbarText(const char *szModule, const wchar_t *wszId, const wchar_t *wszText) { - mir_cslock lck(csChat); - if (SESSION_INFO *si = chatApi.SM_FindSession(wszId, szModule)) { + SESSION_INFO *si; + { + mir_cslock lck(csChat); + si = chatApi.SM_FindSession(wszId, szModule); + } + if (si != nullptr) { replaceStrW(si->ptszStatusbarText, wszText); if (si->ptszStatusbarText) db_set_ws(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText); -- cgit v1.2.3