You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-25 05:23:13 +03:00
Fix PR comments
This commit is contained in:
@@ -33,7 +33,7 @@ import {
|
|||||||
import { Crypto } from "../crypto";
|
import { Crypto } from "../crypto";
|
||||||
import { deepSortedObjectEntries } from "../utils";
|
import { deepSortedObjectEntries } from "../utils";
|
||||||
import { RoomMember } from "./room-member";
|
import { RoomMember } from "./room-member";
|
||||||
import { Thread, THREAD_EVENTS } from "./thread";
|
import { Thread, ThreadEvents } from "./thread";
|
||||||
import { IActionsObject } from '../pushprocessor';
|
import { IActionsObject } from '../pushprocessor';
|
||||||
import { ReEmitter } from '../ReEmitter';
|
import { ReEmitter } from '../ReEmitter';
|
||||||
|
|
||||||
@@ -1321,7 +1321,7 @@ export class MatrixEvent extends EventEmitter {
|
|||||||
*/
|
*/
|
||||||
public setThread(thread: Thread): void {
|
public setThread(thread: Thread): void {
|
||||||
this.thread = thread;
|
this.thread = thread;
|
||||||
this.reEmitter.reEmit(thread, [THREAD_EVENTS.ready, THREAD_EVENTS.update]);
|
this.reEmitter.reEmit(thread, [ThreadEvents.Ready, ThreadEvents.Update]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ import { IRoomVersionsCapability, MatrixClient, PendingEventOrdering, RoomVersio
|
|||||||
import { JoinRule, ResizeMethod } from "../@types/partials";
|
import { JoinRule, ResizeMethod } from "../@types/partials";
|
||||||
import { Filter } from "../filter";
|
import { Filter } from "../filter";
|
||||||
import { RoomState } from "./room-state";
|
import { RoomState } from "./room-state";
|
||||||
import { Thread, THREAD_EVENTS } from "./thread";
|
import { Thread, ThreadEvents } from "./thread";
|
||||||
|
|
||||||
// These constants are used as sane defaults when the homeserver doesn't support
|
// These constants are used as sane defaults when the homeserver doesn't support
|
||||||
// the m.room_versions capability. In practice, KNOWN_SAFE_ROOM_VERSION should be
|
// the m.room_versions capability. In practice, KNOWN_SAFE_ROOM_VERSION should be
|
||||||
@@ -1074,9 +1074,9 @@ export class Room extends EventEmitter {
|
|||||||
public addThread(thread: Thread): Set<Thread> {
|
public addThread(thread: Thread): Set<Thread> {
|
||||||
this.threads.add(thread);
|
this.threads.add(thread);
|
||||||
if (!thread.ready) {
|
if (!thread.ready) {
|
||||||
thread.once(THREAD_EVENTS.ready, this.dedupeThreads);
|
thread.once(ThreadEvents.Ready, this.dedupeThreads);
|
||||||
this.emit(THREAD_EVENTS.update, thread);
|
this.emit(ThreadEvents.Update, thread);
|
||||||
this.reEmitter.reEmit(thread, [THREAD_EVENTS.update, THREAD_EVENTS.ready]);
|
this.reEmitter.reEmit(thread, [ThreadEvents.Update, ThreadEvents.Ready]);
|
||||||
}
|
}
|
||||||
return this.threads;
|
return this.threads;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ import { MatrixEvent } from "./event";
|
|||||||
import { EventTimelineSet } from './event-timeline-set';
|
import { EventTimelineSet } from './event-timeline-set';
|
||||||
import { Room } from './room';
|
import { Room } from './room';
|
||||||
|
|
||||||
export enum THREAD_EVENTS {
|
export enum ThreadEvents {
|
||||||
ready = "Thread.ready",
|
Ready = "Thread.ready",
|
||||||
update = "Thread.update"
|
Update = "Thread.update"
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -78,7 +78,7 @@ export class Thread extends EventEmitter {
|
|||||||
if (this.ready) {
|
if (this.ready) {
|
||||||
this.client.decryptEventIfNeeded(event, {});
|
this.client.decryptEventIfNeeded(event, {});
|
||||||
}
|
}
|
||||||
this.emit(THREAD_EVENTS.ready, this);
|
this.emit(ThreadEvents.Ready, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -101,7 +101,7 @@ export class Thread extends EventEmitter {
|
|||||||
await this.fetchReplyChain();
|
await this.fetchReplyChain();
|
||||||
} else {
|
} else {
|
||||||
await this.decryptEvents();
|
await this.decryptEvents();
|
||||||
this.emit(THREAD_EVENTS.ready, this);
|
this.emit(ThreadEvents.Ready, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -199,23 +199,23 @@ export class Thread extends EventEmitter {
|
|||||||
return this.timelineSet.findEventById(eventId) instanceof MatrixEvent;
|
return this.timelineSet.findEventById(eventId) instanceof MatrixEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public on(event: THREAD_EVENTS, listener: (...args: any[]) => void): this {
|
public on(event: ThreadEvents, listener: (...args: any[]) => void): this {
|
||||||
super.on(event, listener);
|
super.on(event, listener);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
public once(event: THREAD_EVENTS, listener: (...args: any[]) => void): this {
|
public once(event: ThreadEvents, listener: (...args: any[]) => void): this {
|
||||||
super.once(event, listener);
|
super.once(event, listener);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
public off(event: THREAD_EVENTS, listener: (...args: any[]) => void): this {
|
public off(event: ThreadEvents, listener: (...args: any[]) => void): this {
|
||||||
super.off(event, listener);
|
super.off(event, listener);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
public addListener(event: THREAD_EVENTS, listener: (...args: any[]) => void): this {
|
public addListener(event: ThreadEvents, listener: (...args: any[]) => void): this {
|
||||||
super.addListener(event, listener);
|
super.addListener(event, listener);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
public removeListener(event: THREAD_EVENTS, listener: (...args: any[]) => void): this {
|
public removeListener(event: ThreadEvents, listener: (...args: any[]) => void): this {
|
||||||
super.removeListener(event, listener);
|
super.removeListener(event, listener);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user