Post-merge fixes: remove duplicate IncomingCallNotification, restore PiP touch drag + grip dots, show redacted message content
- Router.tsx: remove IncomingCallNotification (CallEmbedProvider.IncomingCallListener now handles all calls) - CallEmbedProvider: restore touch drag (handlePipTouchStart), grip dots on resize handles, fix normaliseToTopLeft width/height - FallbackContent/MsgTypeRenderers: add originalBody prop to show struck-through original text on deleted messages - RoomTimeline: cache text message bodies so they can be shown after redaction
This commit is contained in:
@@ -506,6 +506,8 @@ export function RoomTimeline({ room, eventId, roomInputRef, editor }: RoomTimeli
|
||||
smooth: true,
|
||||
});
|
||||
|
||||
const redactedBodyCache = useRef<Map<string, string>>(new Map());
|
||||
|
||||
const [focusItem, setFocusItem] = useState<
|
||||
| {
|
||||
index: number;
|
||||
@@ -1035,6 +1037,14 @@ export function RoomTimeline({ room, eventId, roomInputRef, editor }: RoomTimeli
|
||||
const getContent = (() =>
|
||||
editedEvent?.getContent()['m.new_content'] ?? mEvent.getContent()) as GetContentCallback;
|
||||
|
||||
// Cache body before it can be stripped by redaction
|
||||
if (!mEvent.isRedacted()) {
|
||||
const c = mEvent.getContent();
|
||||
if (c.body && ['m.text', 'm.notice', 'm.emote'].includes(c.msgtype ?? '')) {
|
||||
redactedBodyCache.current.set(mEventId, c.body);
|
||||
}
|
||||
}
|
||||
|
||||
const senderId = mEvent.getSender() ?? '';
|
||||
const senderDisplayName =
|
||||
getMemberDisplayName(room, senderId) ?? getMxIdLocalPart(senderId) ?? senderId;
|
||||
@@ -1096,7 +1106,10 @@ export function RoomTimeline({ room, eventId, roomInputRef, editor }: RoomTimeli
|
||||
dateFormatString={dateFormatString}
|
||||
>
|
||||
{mEvent.isRedacted() ? (
|
||||
<RedactedContent reason={mEvent.getUnsigned().redacted_because?.content.reason} />
|
||||
<RedactedContent
|
||||
reason={mEvent.getUnsigned().redacted_because?.content.reason}
|
||||
originalBody={redactedBodyCache.current.get(mEventId)}
|
||||
/>
|
||||
) : (
|
||||
<RenderMessageContent
|
||||
displayName={senderDisplayName}
|
||||
|
||||
Reference in New Issue
Block a user