diff options
author | George Hazan <george.hazan@gmail.com> | 2023-12-04 22:24:40 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-12-04 22:24:40 +0300 |
commit | 6b91d1ea4625bb25f194b5a4597b75a7547f40f1 (patch) | |
tree | dbe14c29836e9d13d64acd7dd0f173d6e20673c0 /src/mir_app | |
parent | d69c39adad9038702c055363c2f0dcf8e4fe7b8f (diff) |
fixes #4013 (Telegram: добавления в чат показываются как неизвестные события)
Diffstat (limited to 'src/mir_app')
-rw-r--r-- | src/mir_app/src/chat_log.cpp | 1 | ||||
-rw-r--r-- | src/mir_app/src/chat_manager.cpp | 13 | ||||
-rw-r--r-- | src/mir_app/src/chat_svc.cpp | 4 |
3 files changed, 11 insertions, 7 deletions
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;
|