mirror of
https://github.com/danog/telegram-tt.git
synced 2024-11-27 04:45:08 +01:00
Message: Show correct message sender when forwarding (another attempt) (#1822)
This commit is contained in:
parent
2866922d3c
commit
b06bbe1197
@ -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
|
||||
|
@ -16,6 +16,7 @@ import {
|
||||
selectEditingId,
|
||||
selectEditingScheduledId,
|
||||
selectEditingMessage,
|
||||
selectIsChatWithSelf,
|
||||
} from '../../../global/selectors';
|
||||
import captureEscKeyListener from '../../../util/captureEscKeyListener';
|
||||
import buildClassName from '../../../util/buildClassName';
|
||||
@ -127,7 +128,6 @@ export default memo(withGlobal<OwnProps>(
|
||||
}
|
||||
|
||||
const {
|
||||
currentUserId,
|
||||
forwardMessages: { fromChatId, toChatId, messageIds: forwardMessageIds },
|
||||
} = global;
|
||||
|
||||
@ -150,18 +150,25 @@ export default memo(withGlobal<OwnProps>(
|
||||
let sender: ApiChat | ApiUser | undefined;
|
||||
if (replyingToId && message) {
|
||||
const { forwardInfo } = message;
|
||||
const isChatWithSelf = chatId === currentUserId;
|
||||
|
||||
const isChatWithSelf = selectIsChatWithSelf(global, chatId);
|
||||
if (forwardInfo && (forwardInfo.isChannelPost || isChatWithSelf)) {
|
||||
sender = selectForwardedSender(global, message);
|
||||
}
|
||||
|
||||
if (!sender) {
|
||||
if (!sender && !forwardInfo?.hiddenUserName) {
|
||||
sender = selectSender(global, message);
|
||||
}
|
||||
} else if (isForwarding) {
|
||||
if (message) {
|
||||
sender = selectForwardedSender(global, message);
|
||||
if (!sender) {
|
||||
sender = selectSender(global, message);
|
||||
}
|
||||
}
|
||||
if (!sender) {
|
||||
sender = isUserId(fromChatId!) ? selectUser(global, fromChatId!) : selectChat(global, fromChatId!);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
replyingToId,
|
||||
|
Loading…
Reference in New Issue
Block a user