Revert "Message: Show correct message sender when forwarding (#1784)"

This reverts commit 754ef496220dbbf6580d3a77d705578cd8cfb645.
This commit is contained in:
Alexander Zinchuk 2022-04-09 03:45:51 +02:00
parent 8881cdf77d
commit b5ae6d3205
2 changed files with 5 additions and 6 deletions

View File

@ -54,7 +54,7 @@ const EmbeddedMessage: FC<OwnProps> = ({
const lang = useLang();
const senderTitle = message?.forwardInfo?.hiddenUserName || (sender && getSenderTitle(lang, sender));
const senderTitle = sender && getSenderTitle(lang, sender);
return (
<div

View File

@ -148,9 +148,10 @@ export default memo(withGlobal<OwnProps>(
}
let sender: ApiChat | ApiUser | undefined;
if ((isForwarding || replyingToId) && message) {
if (replyingToId && message) {
const { forwardInfo } = message;
const isChatWithSelf = chatId === currentUserId;
if (forwardInfo && (forwardInfo.isChannelPost || isChatWithSelf)) {
sender = selectForwardedSender(global, message);
}
@ -158,10 +159,8 @@ export default memo(withGlobal<OwnProps>(
if (!sender) {
sender = selectSender(global, message);
}
if (!sender) {
sender = isUserId(fromChatId!) ? selectUser(global, fromChatId!) : selectChat(global, fromChatId!);
}
} else if (isForwarding) {
sender = isUserId(fromChatId!) ? selectUser(global, fromChatId!) : selectChat(global, fromChatId!);
}
return {