Message: Fix applying some updates (#5625)

This commit is contained in:
zubiden 2025-03-01 17:58:58 +01:00 committed by Alexander Zinchuk
parent 8a2f067c9b
commit f8d0eb7311
2 changed files with 5 additions and 5 deletions

View File

@ -225,7 +225,7 @@ export function buildApiMessageWithChatId(
const savedPeerId = mtpMessage.savedPeerId && getApiChatIdFromMtpPeer(mtpMessage.savedPeerId);
return omitUndefined<ApiMessage>({
return {
id: mtpMessage.id,
chatId,
isOutgoing,
@ -270,7 +270,7 @@ export function buildApiMessageWithChatId(
isInvertedMedia,
isVideoProcessingPending,
reportDeliveryUntilDate: mtpMessage.reportDeliveryUntilDate,
});
};
}
export function buildMessageDraft(draft: GramJs.TypeDraftMessage): ApiDraft | undefined {

View File

@ -21,7 +21,7 @@ import {
import { areDeepEqual } from '../../util/areDeepEqual';
import { getCurrentTabId } from '../../util/establishMultitabRole';
import {
areSortedArraysEqual, excludeSortedArray, omit, pick, pickTruthy, unique,
areSortedArraysEqual, excludeSortedArray, omit, omitUndefined, pick, pickTruthy, unique,
} from '../../util/iteratees';
import { isLocalMessageId, type MessageKey } from '../../util/keys/messageKey';
import {
@ -273,11 +273,11 @@ export function updateChatMessage<T extends GlobalState>(
);
}
const updatedMessage = {
const updatedMessage = omitUndefined({
...message,
...messageUpdate,
emojiOnlyCount,
};
});
if (!updatedMessage.id) {
return global;