Comments: Periodically update recent repliers and unreads (#2845)

This commit is contained in:
Alexander Zinchuk 2023-03-19 22:33:28 -05:00
parent f7ff7bf598
commit 2948c395b1
2 changed files with 7 additions and 0 deletions

View File

@ -70,6 +70,7 @@ import { interpolateArray } from '../../../util/waveform';
import { requestChatUpdate } from './chats';
import { getEmojiOnlyCountForMessage } from '../../../global/helpers/getEmojiOnlyCountForMessage';
import { getServerTimeOffset } from '../../../util/serverTime';
import { getApiChatIdFromMtpPeer } from '../apiBuilders/peers';
const FAST_SEND_TIMEOUT = 1000;
const INPUT_WAVEFORM_LENGTH = 63;
@ -883,6 +884,9 @@ export async function fetchMessageViews({
views,
forwards,
messagesCount: replies?.replies,
recentReplierIds: replies?.recentRepliers?.map(getApiChatIdFromMtpPeer),
maxId: replies?.maxId,
readMaxId: replies?.readMaxId,
};
});
}

View File

@ -1488,6 +1488,9 @@ addActionHandler('loadMessageViews', async (global, actions, payload): Promise<v
global = updateThreadInfo(global, repliesChatId, threadId, {
messagesCount: update.messagesCount,
recentReplierIds: update.recentReplierIds,
lastMessageId: update.maxId,
lastReadInboxMessageId: update.readMaxId,
});
});