From cfd6a373fb30755b26fb4d461c3f471403c70c7f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 31 Mar 2020 19:53:16 +0300 Subject: =?UTF-8?q?fixes=20#2262=20(StdMsg:=20=D0=B1=D0=B0=D0=B3=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B8=20=D0=BA=D0=BE=D0=BD=D1=82=D0=B0=D0=BA=D1=82=D0=B0?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/stdmsg/src/msgdialog.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 4f04cdca16..c1bc480784 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -1681,6 +1681,28 @@ void CMsgDialog::UpdateTitle() if (mir_wstrcmp(newtitle, oldtitle)) //swt() flickers even if the title hasn't actually changed SetWindowText(m_pOwner->GetHwnd(), newtitle); } + + if (!isChat()) { + int idx = m_pOwner->m_tab.GetDlgIndex(this); + if (idx == -1) + return; + + auto *pwszName = Clist_GetContactDisplayName(m_hContact); + wchar_t oldtitle[256]; + + TCITEM ti; + ti.mask = TCIF_TEXT; + ti.pszText = oldtitle; + ti.cchTextMax = _countof(oldtitle); + TabCtrl_GetItem(m_pOwner->m_tab.GetHwnd(), idx, &ti); + + // change text only if it was changed + if (mir_wstrcmp(pwszName, oldtitle)) { + ti.pszText = pwszName; + ti.cchTextMax = 0; + TabCtrl_SetItem(m_pOwner->m_tab.GetHwnd(), idx, &ti); + } + } } void CMsgDialog::UserTyping(int nSecs) -- cgit v1.2.3