You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-28 05:03:59 +03:00
Add thread relation to sticker message (#2147)
This commit is contained in:
@@ -4212,6 +4212,18 @@ export class MatrixClient extends EventEmitter {
|
||||
info: info,
|
||||
body: text,
|
||||
};
|
||||
|
||||
const thread = this.getRoom(roomId)?.threads.get(threadId);
|
||||
if (thread) {
|
||||
content["m.relates_to"] = {
|
||||
"rel_type": RelationType.Thread,
|
||||
"event_id": threadId,
|
||||
"m.in_reply_to": {
|
||||
"event_id": thread.replyToEvent.getId(),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
return this.sendEvent(roomId, threadId, EventType.Sticker, content, undefined, callback);
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ export class Thread extends TypedEventEmitter<ThreadEvent> {
|
||||
"Room.timelineReset",
|
||||
]);
|
||||
|
||||
opts?.initialEvents.forEach(event => this.addEvent(event));
|
||||
opts?.initialEvents?.forEach(event => this.addEvent(event));
|
||||
|
||||
this.room.on("Room.localEchoUpdated", this.onEcho);
|
||||
this.room.on("Room.timeline", this.onEcho);
|
||||
|
||||
Reference in New Issue
Block a user