You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-04 05:02:41 +03:00
Merge pull request #1945 from matrix-org/gsouquet/thread-serialise-18720
This commit is contained in:
@@ -26,6 +26,11 @@ export enum ThreadEvent {
|
||||
Update = "Thread.update"
|
||||
}
|
||||
|
||||
interface ISerialisedThread {
|
||||
id: string;
|
||||
tails: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
*/
|
||||
@@ -206,6 +211,13 @@ export class Thread extends EventEmitter {
|
||||
return this.timelineSet.findEventById(eventId) instanceof MatrixEvent;
|
||||
}
|
||||
|
||||
public toJson(): ISerialisedThread {
|
||||
return {
|
||||
id: this.id,
|
||||
tails: Array.from(this.tail),
|
||||
};
|
||||
}
|
||||
|
||||
public on(event: ThreadEvent, listener: (...args: any[]) => void): this {
|
||||
super.on(event, listener);
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user