Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Attach composer IRelation to slash commands content (#7125)
Browse files Browse the repository at this point in the history
  • Loading branch information
germain-gg committed Nov 12, 2021
1 parent 1e50636 commit 77c7946
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/views/rooms/SendMessageComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ function addReplyToMessageContent(
content: IContent,
replyToEvent: MatrixEvent,
permalinkCreator: RoomPermalinkCreator,
relation?: IEventRelation,
): void {
const replyContent = ReplyChain.makeReplyMixIn(replyToEvent);
Object.assign(content, replyContent);
Expand All @@ -78,7 +77,12 @@ function addReplyToMessageContent(
}
content.body = nestedReply.body + content.body;
}
}

export function attachRelation(
content: IContent,
relation?: IEventRelation,
): void {
if (relation) {
content['m.relates_to'] = {
...relation, // the composer can have a default
Expand Down Expand Up @@ -417,9 +421,9 @@ export class SendMessageComposer extends React.Component<ISendMessageComposerPro
content,
replyToEvent,
this.props.permalinkCreator,
this.props.relation,
);
}
attachRelation(content, this.props.relation);
} else {
this.runSlashCommand(cmd, args);
shouldSend = false;
Expand Down

0 comments on commit 77c7946

Please sign in to comment.