Chat: Fix missing thread info in update (#6648)

This commit is contained in:
zubiden 2026-02-22 23:42:57 +01:00 committed by Alexander Zinchuk
parent d0ba0c2530
commit 2ccbe341e2
2 changed files with 8 additions and 1 deletions

View File

@ -523,6 +523,7 @@ export async function requestChatUpdate({
const chatUpdate = buildApiChatFromDialog(dialog, peerEntity); const chatUpdate = buildApiChatFromDialog(dialog, peerEntity);
const readState = buildThreadReadState(dialog); const readState = buildThreadReadState(dialog);
const threadInfo = buildApiThreadInfoFromDialog(chat.id, dialog);
sendApiUpdate({ sendApiUpdate({
'@type': 'updateThreadReadState', '@type': 'updateThreadReadState',
chatId: id, chatId: id,
@ -530,6 +531,11 @@ export async function requestChatUpdate({
readState, readState,
}); });
sendApiUpdate({
'@type': 'updateThreadInfo',
threadInfo,
});
sendApiUpdate({ sendApiUpdate({
'@type': 'updateChat', '@type': 'updateChat',
id, id,

View File

@ -237,13 +237,14 @@ addActionHandler('openChat', (global, actions, payload): ActionReturnType => {
} }
const chat = selectChat(global, id); const chat = selectChat(global, id);
const threadInfo = selectThreadInfo(global, id, MAIN_THREAD_ID);
const chatReadState = selectThreadReadState(global, id, MAIN_THREAD_ID); const chatReadState = selectThreadReadState(global, id, MAIN_THREAD_ID);
if (chatReadState?.hasUnreadMark) { if (chatReadState?.hasUnreadMark) {
actions.markChatRead({ id }); actions.markChatRead({ id });
} }
const isChatOnlySummary = !selectChatLastMessageId(global, id); const isChatOnlySummary = !threadInfo || !selectChatLastMessageId(global, id);
if (!chat) { if (!chat) {
if (selectIsChatWithSelf(global, id)) { if (selectIsChatWithSelf(global, id)) {