From 9081e019f31dbae679d826db0fa2e590a01788a5 Mon Sep 17 00:00:00 2001 From: Filipe Medeiros Date: Wed, 5 Nov 2025 13:17:08 +0000 Subject: [PATCH] Add possibility to upload media inside thread --- src/app/features/room/RoomInput.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/app/features/room/RoomInput.tsx b/src/app/features/room/RoomInput.tsx index ae46d2d098..f5294b11fe 100644 --- a/src/app/features/room/RoomInput.tsx +++ b/src/app/features/room/RoomInput.tsx @@ -293,7 +293,14 @@ export const RoomInput = forwardRef( }); handleCancelUpload(uploads); const contents = fulfilledPromiseSettledResult(await Promise.allSettled(contentsPromises)); - contents.forEach((content) => mx.sendMessage(roomId, content as any)); + contents.forEach((content) => { + if (replyDraft?.relation?.rel_type === RelationType.Thread) { + content['m.relates_to'].event_id = replyDraft.relation.event_id; + content['m.relates_to'].rel_type = RelationType.Thread; + content['m.relates_to'].is_falling_back = false; + } + mx.sendMessage(roomId, content as any) + }); }; const submit = useCallback(() => {