From 6b91d1ea4625bb25f194b5a4597b75a7547f40f1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 4 Dec 2023 22:24:40 +0300 Subject: =?UTF-8?q?fixes=20#4013=20(Telegram:=20=D0=B4=D0=BE=D0=B1=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B2=20=D1=87=D0=B0?= =?UTF-8?q?=D1=82=20=D0=BF=D0=BE=D0=BA=D0=B0=D0=B7=D1=8B=D0=B2=D0=B0=D1=8E?= =?UTF-8?q?=D1=82=D1=81=D1=8F=20=D0=BA=D0=B0=D0=BA=20=D0=BD=D0=B5=D0=B8?= =?UTF-8?q?=D0=B7=D0=B2=D0=B5=D1=81=D1=82=D0=BD=D1=8B=D0=B5=20=D1=81=D0=BE?= =?UTF-8?q?=D0=B1=D1=8B=D1=82=D0=B8=D1=8F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mir_app/src/chat_log.cpp | 1 + src/mir_app/src/chat_manager.cpp | 13 +++++++------ src/mir_app/src/chat_svc.cpp | 4 +++- 3 files changed, 11 insertions(+), 7 deletions(-) (limited to 'src/mir_app') diff --git a/src/mir_app/src/chat_log.cpp b/src/mir_app/src/chat_log.cpp index a209e6f434..8ef8ffca1e 100644 --- a/src/mir_app/src/chat_log.cpp +++ b/src/mir_app/src/chat_log.cpp @@ -98,6 +98,7 @@ MIR_APP_DLL(bool) Chat_GetDefaultEventDescr(const SESSION_INFO *si, const LOGINF return true; case GC_EVENT_ADDSTATUS: + case GC_EVENT_SETSTATUS: if (lin->ptszNick && lin->ptszText && lin->ptszStatus) res.AppendFormat(TranslateT("%s enables '%s' status for %s"), lin->ptszText, lin->ptszStatus, lin->ptszNick); return true; diff --git a/src/mir_app/src/chat_manager.cpp b/src/mir_app/src/chat_manager.cpp index 613bbd3f48..f849da254b 100644 --- a/src/mir_app/src/chat_manager.cpp +++ b/src/mir_app/src/chat_manager.cpp @@ -409,13 +409,14 @@ BOOL SM_GiveStatus(SESSION_INFO *si, const wchar_t *pszUID, const wchar_t *pszSt BOOL SM_AssignStatus(SESSION_INFO *si, const wchar_t *pszUID, const wchar_t *pszStatus) { - if (si == nullptr) - return FALSE; + if (si != nullptr) + if (USERINFO *ui = UM_SetStatus(si, pszUID, TM_StringToWord(si->pStatuses, pszStatus))) { + if (si->pDlg) + si->pDlg->UpdateNickList(); + return TRUE; + } - USERINFO *ui = UM_SetStatus(si, pszUID, TM_StringToWord(si->pStatuses, pszStatus)); - if (ui && si->pDlg) - si->pDlg->UpdateNickList(); - return TRUE; + return FALSE; } BOOL SM_SetContactStatus(SESSION_INFO *si, const wchar_t *pszUID, uint16_t wStatus) diff --git a/src/mir_app/src/chat_svc.cpp b/src/mir_app/src/chat_svc.cpp index 28bfcba762..b7a759e3f0 100644 --- a/src/mir_app/src/chat_svc.cpp +++ b/src/mir_app/src/chat_svc.cpp @@ -495,7 +495,9 @@ static BOOL HandleChatEvent(GCEVENT &gce, int bManyFix) break; case GC_EVENT_SETSTATUS: - SM_AssignStatus(si, gce.pszUID.w, gce.pszStatus.w); + if (!SM_AssignStatus(si, gce.pszUID.w, gce.pszStatus.w)) + return 0; + bIsHighlighted = g_chatApi.IsHighlighted(si, &gce); break; -- cgit v1.2.3