Fix explicit replies in threads (#8210)
This commit is contained in:
parent
f4c25e06cd
commit
17cfd45eb3
3 changed files with 22 additions and 27 deletions
|
@ -60,14 +60,12 @@ import { KeyBindingAction } from "../../../accessibility/KeyboardShortcuts";
|
|||
import { PosthogAnalytics } from "../../../PosthogAnalytics";
|
||||
import { addReplyToMessageContent } from '../../../utils/Reply';
|
||||
|
||||
export function attachRelation(
|
||||
content: IContent,
|
||||
relation?: IEventRelation,
|
||||
): void {
|
||||
// Merges favouring the given relation
|
||||
export function attachRelation(content: IContent, relation?: IEventRelation): void {
|
||||
if (relation) {
|
||||
content['m.relates_to'] = {
|
||||
...relation, // the composer can have a default
|
||||
...content['m.relates_to'],
|
||||
...(content['m.relates_to'] || {}),
|
||||
...relation,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -100,6 +98,7 @@ export function createMessageContent(
|
|||
content.formatted_body = formattedBody;
|
||||
}
|
||||
|
||||
attachRelation(content, relation);
|
||||
if (replyToEvent) {
|
||||
addReplyToMessageContent(content, replyToEvent, {
|
||||
permalinkCreator,
|
||||
|
@ -107,13 +106,6 @@ export function createMessageContent(
|
|||
});
|
||||
}
|
||||
|
||||
if (relation) {
|
||||
content['m.relates_to'] = {
|
||||
...relation,
|
||||
...content['m.relates_to'],
|
||||
};
|
||||
}
|
||||
|
||||
return content;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue