diff --git a/.changeset/fix_forwarding_metadata.md b/.changeset/fix_forwarding_metadata.md
new file mode 100644
index 000000000..36e502232
--- /dev/null
+++ b/.changeset/fix_forwarding_metadata.md
@@ -0,0 +1,5 @@
+---
+default: patch
+---
+
+fix forwarding metadata by removing the `null` value
diff --git a/src/app/components/message/modals/MessageForward.tsx b/src/app/components/message/modals/MessageForward.tsx
index 219e41197..a35d583ff 100644
--- a/src/app/components/message/modals/MessageForward.tsx
+++ b/src/app/components/message/modals/MessageForward.tsx
@@ -93,9 +93,9 @@ type ForwardMeta = {
// see https://github.com/hummlbach/matrix-doc/blob/acea0854a1c9489599295a858b068ce02a6b2b20/proposals/2723-add-forward-info.md
type MSC2723ForwardMeta = {
- event_id: string;
- room_id: string;
- sender: string | null; // we won't set this field
+ event_id?: string;
+ room_id?: string;
+ sender?: string; // we won't set this field
origin_server_ts: number;
};
@@ -205,9 +205,9 @@ export function MessageForwardInternal({
newBodyPlain = originalBody.length > 0 ? `${bodyModifText}\n\n${quotedBody}` : bodyModifText;
const safeHtml =
- originalFormattedBody !== undefined
- ? sanitizeCustomHtml(originalFormattedBody)
- : sanitizeCustomHtml(originalBody).replaceAll('\n', '
');
+ originalFormattedBody === undefined
+ ? sanitizeCustomHtml(originalBody).replaceAll('\n', '
')
+ : sanitizeCustomHtml(originalFormattedBody);
newBodyHtml =
`