Message: Fix incorrect sender preview when forwarding with Send As (#5215)
This commit is contained in:
parent
391039ad97
commit
c6e630d5e0
@ -996,6 +996,7 @@ export function buildLocalForwardedMessage({
|
|||||||
noCaptions,
|
noCaptions,
|
||||||
isCurrentUserPremium,
|
isCurrentUserPremium,
|
||||||
lastMessageId,
|
lastMessageId,
|
||||||
|
sendAs,
|
||||||
}: {
|
}: {
|
||||||
toChat: ApiChat;
|
toChat: ApiChat;
|
||||||
toThreadId?: number;
|
toThreadId?: number;
|
||||||
@ -1005,6 +1006,7 @@ export function buildLocalForwardedMessage({
|
|||||||
noCaptions?: boolean;
|
noCaptions?: boolean;
|
||||||
isCurrentUserPremium?: boolean;
|
isCurrentUserPremium?: boolean;
|
||||||
lastMessageId?: number;
|
lastMessageId?: number;
|
||||||
|
sendAs?: ApiPeer;
|
||||||
}): ApiMessage {
|
}): ApiMessage {
|
||||||
const localId = getNextLocalMessageId(lastMessageId);
|
const localId = getNextLocalMessageId(lastMessageId);
|
||||||
const {
|
const {
|
||||||
@ -1049,7 +1051,7 @@ export function buildLocalForwardedMessage({
|
|||||||
content: updatedContent,
|
content: updatedContent,
|
||||||
date: scheduledAt || Math.round(Date.now() / 1000) + getServerTimeOffset(),
|
date: scheduledAt || Math.round(Date.now() / 1000) + getServerTimeOffset(),
|
||||||
isOutgoing: !asIncomingInChatWithSelf && toChat.type !== 'chatTypeChannel',
|
isOutgoing: !asIncomingInChatWithSelf && toChat.type !== 'chatTypeChannel',
|
||||||
senderId: currentUserId,
|
senderId: sendAs?.id || currentUserId,
|
||||||
sendingState: 'messageSendingStatePending',
|
sendingState: 'messageSendingStatePending',
|
||||||
groupedId,
|
groupedId,
|
||||||
isInAlbum,
|
isInAlbum,
|
||||||
@ -1059,7 +1061,7 @@ export function buildLocalForwardedMessage({
|
|||||||
...(toThreadId && toChat?.isForum && { isTopicReply: true }),
|
...(toThreadId && toChat?.isForum && { isTopicReply: true }),
|
||||||
|
|
||||||
...(emojiOnlyCount && { emojiOnlyCount }),
|
...(emojiOnlyCount && { emojiOnlyCount }),
|
||||||
// Forward info doesn't get added when users forwards his own messages, also when forwarding audio
|
// Forward info doesn't get added when user forwards own messages and when forwarding audio
|
||||||
...(message.chatId !== currentUserId && !isAudio && !noAuthors && {
|
...(message.chatId !== currentUserId && !isAudio && !noAuthors && {
|
||||||
forwardInfo: {
|
forwardInfo: {
|
||||||
date: message.forwardInfo?.date || message.date,
|
date: message.forwardInfo?.date || message.date,
|
||||||
|
|||||||
@ -1527,6 +1527,7 @@ export async function forwardMessages({
|
|||||||
noCaptions,
|
noCaptions,
|
||||||
isCurrentUserPremium,
|
isCurrentUserPremium,
|
||||||
lastMessageId,
|
lastMessageId,
|
||||||
|
sendAs,
|
||||||
});
|
});
|
||||||
localMessages[randomIds[index].toString()] = localMessage;
|
localMessages[randomIds[index].toString()] = localMessage;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user