diff --git a/src/matrix/room/timeline/entries/BaseEventEntry.js b/src/matrix/room/timeline/entries/BaseEventEntry.js index b3ac3e9c..884bffa9 100644 --- a/src/matrix/room/timeline/entries/BaseEventEntry.js +++ b/src/matrix/room/timeline/entries/BaseEventEntry.js @@ -18,7 +18,7 @@ import {BaseEntry} from "./BaseEntry"; import {REDACTION_TYPE} from "../../common.js"; import {createAnnotation, ANNOTATION_RELATION_TYPE, getRelationFromContent} from "../relations.js"; import {PendingAnnotation} from "../PendingAnnotation.js"; -import {createReplyContent} from "./reply.js" +import {createReplyContent, THREADING_REL_TYPE} from "./reply.js" /** Deals mainly with local echo for relations and redactions, * so it is shared between PendingEventEntry and EventEntry */ @@ -36,7 +36,7 @@ export class BaseEventEntry extends BaseEntry { } get isThread() { - return this.relation?.["rel_type"] === "io.element.thread"; + return this.relation?.["rel_type"] === THREADING_REL_TYPE; } get isRedacting() { diff --git a/src/matrix/room/timeline/entries/reply.js b/src/matrix/room/timeline/entries/reply.js index bbb2d53d..2fbbd0d4 100644 --- a/src/matrix/room/timeline/entries/reply.js +++ b/src/matrix/room/timeline/entries/reply.js @@ -14,6 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import {getRelatedEventId} from "../relations.js"; + +export const THREADING_REL_TYPE = "io.element.thread"; + function htmlEscape(string) { return string.replace(/&/g, "&").replace(//g, ">"); } @@ -81,8 +85,8 @@ function createThreadContent(entry, msgtype, body) { msgtype, body, "m.relates_to": { - "rel_type": "m.thread", - "event_id": entry.id + "rel_type": THREADING_REL_TYPE, + "event_id": getRelatedEventId(entry) } }; }