mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 17:56:01 +03:00
Attach composer IRelation to slash commands content (#7125)
This commit is contained in:
parent
1e50636520
commit
77c79467c6
1 changed files with 6 additions and 2 deletions
|
@ -64,7 +64,6 @@ function addReplyToMessageContent(
|
|||
content: IContent,
|
||||
replyToEvent: MatrixEvent,
|
||||
permalinkCreator: RoomPermalinkCreator,
|
||||
relation?: IEventRelation,
|
||||
): void {
|
||||
const replyContent = ReplyChain.makeReplyMixIn(replyToEvent);
|
||||
Object.assign(content, replyContent);
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue