mirror of
https://github.com/danog/telegram-tt.git
synced 2024-11-26 20:34:44 +01:00
Message: Show correct message sender when forwarding (#1784)
This commit is contained in:
parent
395786e0f9
commit
1d797bc3ba
@ -54,7 +54,7 @@ const EmbeddedMessage: FC<OwnProps> = ({
|
||||
|
||||
const lang = useLang();
|
||||
|
||||
const senderTitle = sender && getSenderTitle(lang, sender);
|
||||
const senderTitle = message?.forwardInfo?.hiddenUserName || (sender && getSenderTitle(lang, sender));
|
||||
|
||||
return (
|
||||
<div
|
||||
|
@ -148,10 +148,9 @@ export default memo(withGlobal<OwnProps>(
|
||||
}
|
||||
|
||||
let sender: ApiChat | ApiUser | undefined;
|
||||
if (replyingToId && message) {
|
||||
if ((isForwarding || replyingToId) && message) {
|
||||
const { forwardInfo } = message;
|
||||
const isChatWithSelf = chatId === currentUserId;
|
||||
|
||||
if (forwardInfo && (forwardInfo.isChannelPost || isChatWithSelf)) {
|
||||
sender = selectForwardedSender(global, message);
|
||||
}
|
||||
@ -159,8 +158,10 @@ export default memo(withGlobal<OwnProps>(
|
||||
if (!sender) {
|
||||
sender = selectSender(global, message);
|
||||
}
|
||||
} else if (isForwarding) {
|
||||
sender = isUserId(fromChatId!) ? selectUser(global, fromChatId!) : selectChat(global, fromChatId!);
|
||||
|
||||
if (!sender) {
|
||||
sender = isUserId(fromChatId!) ? selectUser(global, fromChatId!) : selectChat(global, fromChatId!);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user