1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

Dispatch thread events

This commit is contained in:
Germain Souquet
2021-08-17 17:43:00 +01:00
parent d56540320e
commit b884accc99
4 changed files with 59 additions and 24 deletions

View File

@@ -30,6 +30,7 @@ import { deepSortedObjectEntries } from "../utils";
import { RoomMember } from "./room-member";
import { Thread } from "./thread";
import { IActionsObject } from '../pushprocessor';
import { ReEmitter } from '../ReEmitter';
/**
* Enum for event statuses.
@@ -217,6 +218,8 @@ export class MatrixEvent extends EventEmitter {
*/
public verificationRequest = null;
private readonly reEmitter: ReEmitter;
/**
* Construct a Matrix Event object
* @constructor
@@ -266,6 +269,7 @@ export class MatrixEvent extends EventEmitter {
this.txnId = event.txn_id || null;
this.localTimestamp = Date.now() - this.getAge();
this.reEmitter = new ReEmitter(this);
}
/**
@@ -1287,6 +1291,7 @@ export class MatrixEvent extends EventEmitter {
public setThread(thread: Thread): void {
this.thread = thread;
this.reEmitter.reEmit(thread, ["Thread.ready", "Thread.update"]);
}
public getThread(): Thread {