Fix replying using chat effect commands (#9101)

This commit is contained in:
Michael Telatynski 2022-07-27 11:03:25 +01:00 committed by GitHub
parent c0d69e1d30
commit a2c5a59b22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 17 deletions

View file

@ -337,7 +337,7 @@ class EditMessageComposer extends React.Component<IEditMessageComposerProps, ISt
return; // errored
}
if (cmd.category === CommandCategories.messages) {
if (cmd.category === CommandCategories.messages || cmd.category === CommandCategories.effects) {
editContent["m.new_content"] = content;
} else {
shouldSend = false;

View file

@ -358,12 +358,13 @@ export class SendMessageComposer extends React.Component<ISendMessageComposerPro
return; // errored
}
if (cmd.category === CommandCategories.messages) {
if (cmd.category === CommandCategories.messages || cmd.category === CommandCategories.effects) {
attachRelation(content, this.props.relation);
if (replyToEvent) {
addReplyToMessageContent(content, replyToEvent, {
permalinkCreator: this.props.permalinkCreator,
includeLegacyFallback: true,
// Exclude the legacy fallback for custom event types such as those used by /fireworks
includeLegacyFallback: content.msgtype?.startsWith("m.") ?? true,
});
}
} else {