Comments: Fix wrong thread info on forwards (#6962)

This commit is contained in:
zubiden 2026-06-01 01:15:44 +02:00 committed by Alexander Zinchuk
parent 6a8ca9b97b
commit a103f09dae

View File

@ -801,7 +801,11 @@ export function buildApiThreadInfo(
channelId, replies, maxId = messageId, recentRepliers, comments, readMaxId,
} = messageReplies;
const { fromId, channelPost } = messageForwardInfo || {};
const {
fromId, channelPost, savedFromPeer, savedFromMsgId,
} = messageForwardInfo || {};
const fromChannelPeer = savedFromPeer || fromId;
const fromMessageId = savedFromMsgId || channelPost;
const apiChannelId = channelId ? buildApiPeerId(channelId, 'channel') : undefined;
if (apiChannelId === DELETED_COMMENTS_CHANNEL_ID) {
@ -830,8 +834,8 @@ export function buildApiThreadInfo(
isCommentsInfo: false,
chatId,
threadId: messageId,
fromChannelId: fromId && channelPost ? getApiChatIdFromMtpPeer(fromId) : undefined,
fromMessageId: channelPost,
fromChannelId: fromChannelPeer && fromMessageId ? getApiChatIdFromMtpPeer(fromChannelPeer) : undefined,
fromMessageId,
});
}