Chat: Fix missing thread info in update (#6648)
This commit is contained in:
parent
d0ba0c2530
commit
2ccbe341e2
@ -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,
|
||||||
|
|||||||
@ -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)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user