Skip to content

Commit 9344cee

Browse files
committed
fix mentions in non-text replies
Signed-off-by: Shea <nu@she-a.eu>
1 parent 262cd12 commit 9344cee

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
default: patch
3+
---
4+
5+
Fix mentions not sending in non-textual replies

src/app/features/room/RoomInput.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,8 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
613613
plainText?.length === 0 ? getReplyContent(replyDraft, room) : undefined;
614614
if (replyContent) {
615615
contents[0]!['m.relates_to'] = replyContent;
616+
if (!silentReply && replyDraft)
617+
contents[0]!['m.mentions'] = { ['user_ids']: [replyDraft.userId] };
616618
setReplyDraft(replyDraftBase);
617619
}
618620
}
@@ -1295,6 +1297,8 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
12951297

12961298
if (replyDraft) {
12971299
content['m.relates_to'] = getReplyContent(replyDraft, room);
1300+
if (!silentReply && replyDraft)
1301+
content['m.mentions'] = { ['user_ids']: [replyDraft.userId] };
12981302
setReplyDraft(replyDraftBase);
12991303
}
13001304
mx.sendEvent(roomId, EventType.Sticker, content);

0 commit comments

Comments
 (0)