added forward meta data for public original messages as defined in MSC2723

see https://github.com/matrix-org/matrix-spec-proposals/pull/2723
This commit is contained in:
Rye committed 2026-03-14 02:59:42 +01:00
1 parent eeae3d5b80
commit bb787c504c
1 file changed
+14
@@ -87,6 +87,14 @@ type ForwardMeta = {
original_event_private: boolean;
};
// 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
origin_server_ts: number;
};
export function MessageForwardInternal({
room,
mEvent,
@@ -244,6 +252,12 @@ export function MessageForwardInternal({
original_event_id: eventId,
original_event_private: false,
} satisfies ForwardMeta,
'com.famedly.app.forwarded': {
event_id: eventId,
room_id: room.roomId,
sender: null, // we won't set this field, as a design decision to avoid potential privacy issues and since the sender can be inferred from the event_id and room_id if needed
origin_server_ts: mEvent.getTs(),
} satisfies MSC2723ForwardMeta,
};
}