Skip to content

Commit 7ebff8e

Browse files
committed
Move helper methods closer to where they are used
1 parent f06c3e6 commit 7ebff8e

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/embedded.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -351,18 +351,6 @@ export class RoomWidgetClient extends MatrixClient {
351351
return this.validateSendDelayedEventResponse(response);
352352
}
353353

354-
/**
355-
* @experimental This currently relies on an unstable MSC (MSC4140).
356-
*/
357-
// eslint-disable-next-line
358-
public async _unstable_updateDelayedEvent(delayId: string, action: UpdateDelayedEventAction): Promise<{}> {
359-
if (!(await this.doesServerSupportUnstableFeature(UNSTABLE_MSC4140_DELAYED_EVENTS))) {
360-
throw Error("Server does not support the delayed events API");
361-
}
362-
363-
return await this.widgetApi.updateDelayedEvent(delayId, action);
364-
}
365-
366354
private validateSendEventResponse(response: ISendEventFromWidgetResponseData): ISendEventResponse {
367355
if (response.event_id === undefined) {
368356
throw new Error("'event_id' absent from response to an event request");
@@ -377,6 +365,18 @@ export class RoomWidgetClient extends MatrixClient {
377365
return { delay_id: response.delay_id };
378366
}
379367

368+
/**
369+
* @experimental This currently relies on an unstable MSC (MSC4140).
370+
*/
371+
// eslint-disable-next-line
372+
public async _unstable_updateDelayedEvent(delayId: string, action: UpdateDelayedEventAction): Promise<{}> {
373+
if (!(await this.doesServerSupportUnstableFeature(UNSTABLE_MSC4140_DELAYED_EVENTS))) {
374+
throw Error("Server does not support the delayed events API");
375+
}
376+
377+
return await this.widgetApi.updateDelayedEvent(delayId, action);
378+
}
379+
380380
public async sendToDevice(eventType: string, contentMap: SendToDeviceContentMap): Promise<{}> {
381381
await this.widgetApi.sendToDevice(eventType, false, recursiveMapToObject(contentMap));
382382
return {};

0 commit comments

Comments
 (0)