fix delayed events

This commit is contained in:
melogale committed 2026-03-16 19:23:46 -04:00
1 parent 643ace6f60
commit abf0848aa6
3 files changed
+35 -1

No files matched your search

@@ -164,6 +164,18 @@ export class GenericWidgetDriver extends WidgetDriver {
await this.mxClient._unstable_updateDelayedEvent(delayId, action);
}
public async cancelScheduledDelayedEvent(delayId: string): Promise<void> {
await this.updateDelayedEvent(delayId, UpdateDelayedEventAction.Cancel);
}
public async restartScheduledDelayedEvent(delayId: string): Promise<void> {
await this.updateDelayedEvent(delayId, UpdateDelayedEventAction.Restart);
}
public async sendScheduledDelayedEvent(delayId: string): Promise<void> {
await this.updateDelayedEvent(delayId, UpdateDelayedEventAction.Send);
}
public async sendToDevice(
eventType: string,
encrypted: boolean,
+10
View File
@@ -9,9 +9,11 @@ import {
} from 'matrix-js-sdk';
import {
ClientWidgetApi,
type IWidgetApiRequest,
IRoomEvent,
IWidget,
Widget,
WidgetApiFromWidgetAction,
WidgetApiToWidgetAction,
WidgetDriver,
} from 'matrix-widget-api';
@@ -149,6 +151,14 @@ export class CallEmbed {
const controlState = initialControlState ?? new CallControlState(true, false, true);
this.control = new CallControl(controlState, call, iframe);
// acknowledge always on screen request to silence error
this.disposables.push(
this.listenAction(WidgetApiFromWidgetAction.UpdateAlwaysOnScreen, (evt) => {
evt.preventDefault();
this.call.transport.reply(evt.detail as IWidgetApiRequest, { success: true });
})
);
let initialMediaEvent = true;
this.disposables.push(
this.listenAction<ElementMediaStateDetail>(ElementWidgetActions.DeviceMute, (evt) => {
+13 -1
View File
@@ -8,7 +8,7 @@ import {
type IWidgetApiErrorResponseDataDetails,
type ISearchUserDirectoryResult,
type IGetMediaConfigResult,
type UpdateDelayedEventAction,
UpdateDelayedEventAction,
OpenIDRequestState,
SimpleObservable,
IOpenIDUpdate,
@@ -165,6 +165,18 @@ export class CallWidgetDriver extends WidgetDriver {
await client._unstable_updateDelayedEvent(delayId, action);
}
public async cancelScheduledDelayedEvent(delayId: string): Promise<void> {
await this.updateDelayedEvent(delayId, UpdateDelayedEventAction.Cancel);
}
public async restartScheduledDelayedEvent(delayId: string): Promise<void> {
await this.updateDelayedEvent(delayId, UpdateDelayedEventAction.Restart);
}
public async sendScheduledDelayedEvent(delayId: string): Promise<void> {
await this.updateDelayedEvent(delayId, UpdateDelayedEventAction.Send);
}
public async sendToDevice(
eventType: string,
encrypted: boolean,