From 05af149ef6d5b35e7c7a074f37e59462b3dc2d56 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 8 May 2018 20:01:12 +0200 Subject: fixes #1329 (StdMsg: bug with "Use the contact's status icon as the window icon") --- src/core/stdmsg/src/msgdialog.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 2456c527bf..59f3cdb76f 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -634,11 +634,12 @@ void CSrmmWindow::UpdateTitle() m_wStatus = db_get_w(m_hContact, m_szProto, "Status", ID_STATUS_OFFLINE); wchar_t *contactName = Clist_GetContactDisplayName(m_hContact); - wchar_t *szStatus = Clist_GetStatusModeDescription(m_szProto == nullptr ? ID_STATUS_OFFLINE : db_get_w(m_hContact, m_szProto, "Status", ID_STATUS_OFFLINE), 0); if (g_dat.bUseStatusWinIcon) mir_snwprintf(newtitle, L"%s - %s", contactName, TranslateT("Message session")); - else + else { + wchar_t *szStatus = Clist_GetStatusModeDescription(m_szProto == nullptr ? ID_STATUS_OFFLINE : db_get_w(m_hContact, m_szProto, "Status", ID_STATUS_OFFLINE), 0); mir_snwprintf(newtitle, L"%s (%s): %s", contactName, szStatus, TranslateT("Message session")); + } m_wOldStatus = m_wStatus; } @@ -1035,8 +1036,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) Window_FreeIcon_IcoLib(m_pOwner->GetHwnd()); if (m_szProto) { - WORD wStatus = db_get_w(m_hContact, m_szProto, "Status", ID_STATUS_OFFLINE); - Window_SetProtoIcon_IcoLib(m_pOwner->GetHwnd(), m_szProto, wStatus); + Window_SetProtoIcon_IcoLib(m_pOwner->GetHwnd(), m_szProto, Contact_GetStatus(m_hContact)); break; } } @@ -1091,6 +1091,8 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) UpdateLastMessage(); if (KillTimer(m_hwnd, TIMERID_FLASHWND)) FlashWindow(m_pOwner->GetHwnd(), FALSE); + if (g_dat.bUseStatusWinIcon) + SendMessage(m_hwnd, DM_UPDATEWINICON, 0, 0); break; case WM_CBD_LOADICONS: -- cgit v1.2.3