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

Commit dc9ec85

Browse files
authored
Match MSC behaviour for threads when disabled (thread-aware mode) (#8476)
1 parent 2141b12 commit dc9ec85

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/utils/Reply.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,17 @@ export function makeReplyMixIn(ev?: MatrixEvent): IEventRelation {
152152
},
153153
};
154154

155-
if (SettingsStore.getValue("feature_thread") && ev.threadRootId) {
156-
mixin.is_falling_back = false;
155+
if (ev.threadRootId) {
156+
if (SettingsStore.getValue("feature_thread")) {
157+
mixin.is_falling_back = false;
158+
} else {
159+
// Clients that do not offer a threading UI should behave as follows when replying, for best interaction
160+
// with those that do. They should set the m.in_reply_to part as usual, and then add on
161+
// "rel_type": "m.thread" and "event_id": "$thread_root", copying $thread_root from the replied-to event.
162+
const relation = ev.getRelation();
163+
mixin.rel_type = relation.rel_type;
164+
mixin.event_id = relation.event_id;
165+
}
157166
}
158167

159168
return mixin;

0 commit comments

Comments
 (0)