You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-08-06 12:02:40 +03:00
s/room_ephemeral/typing/
This commit is contained in:
@@ -809,14 +809,14 @@ describe("SlidingSyncSdk", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe("ExtensionRoomEphemeral", () => {
|
describe("ExtensionTyping", () => {
|
||||||
let ext: Extension;
|
let ext: Extension;
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
await setupClient();
|
await setupClient();
|
||||||
const hasSynced = sdk!.sync();
|
const hasSynced = sdk!.sync();
|
||||||
await httpBackend!.flushAllExpected();
|
await httpBackend!.flushAllExpected();
|
||||||
await hasSynced;
|
await hasSynced;
|
||||||
ext = findExtension("room_ephemeral");
|
ext = findExtension("typing");
|
||||||
});
|
});
|
||||||
it("gets enabled on the initial request only", () => {
|
it("gets enabled on the initial request only", () => {
|
||||||
expect(ext.onRequest(true)).toEqual({
|
expect(ext.onRequest(true)).toEqual({
|
||||||
|
@@ -233,11 +233,11 @@ class ExtensionAccountData implements Extension {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ExtensionRoomEphemeral implements Extension {
|
class ExtensionTyping implements Extension {
|
||||||
public constructor(private readonly client: MatrixClient) {}
|
public constructor(private readonly client: MatrixClient) {}
|
||||||
|
|
||||||
public name(): string {
|
public name(): string {
|
||||||
return "room_ephemeral";
|
return "typing";
|
||||||
}
|
}
|
||||||
|
|
||||||
public when(): ExtensionState {
|
public when(): ExtensionState {
|
||||||
@@ -262,7 +262,7 @@ class ExtensionRoomEphemeral implements Extension {
|
|||||||
const ephemeralEvents = mapEvents(this.client, roomId, data.rooms[roomId]);
|
const ephemeralEvents = mapEvents(this.client, roomId, data.rooms[roomId]);
|
||||||
const room = this.client.getRoom(roomId);
|
const room = this.client.getRoom(roomId);
|
||||||
if (!room) {
|
if (!room) {
|
||||||
logger.warn("got ephemeral events for room but room doesn't exist on client:", roomId);
|
logger.warn("got typing events for room but room doesn't exist on client:", roomId);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
room.addEphemeralEvents(ephemeralEvents);
|
room.addEphemeralEvents(ephemeralEvents);
|
||||||
@@ -313,7 +313,7 @@ export class SlidingSyncSdk {
|
|||||||
const extensions: Extension[] = [
|
const extensions: Extension[] = [
|
||||||
new ExtensionToDevice(this.client),
|
new ExtensionToDevice(this.client),
|
||||||
new ExtensionAccountData(this.client),
|
new ExtensionAccountData(this.client),
|
||||||
new ExtensionRoomEphemeral(this.client),
|
new ExtensionTyping(this.client),
|
||||||
];
|
];
|
||||||
if (this.opts.crypto) {
|
if (this.opts.crypto) {
|
||||||
extensions.push(
|
extensions.push(
|
||||||
|
Reference in New Issue
Block a user