@@ -62,17 +62,6 @@ interface IStateEventRequest {
6262 stateKey ?: string ;
6363}
6464
65- export interface OlmDevice {
66- /**
67- * The user ID of the device owner.
68- */
69- userId : string ;
70- /**
71- * The device ID of the device.
72- */
73- deviceId : string ;
74- }
75-
7665export interface ICapabilities {
7766 /**
7867 * Event types that this client expects to send.
@@ -464,6 +453,9 @@ export class RoomWidgetClient extends MatrixClient {
464453 return { } ;
465454 }
466455
456+ /**
457+ * by {@link MatrixClient.encryptAndSendToDevice}.
458+ */
467459 public async encryptAndSendToDevice (
468460 eventType : string ,
469461 devices : { userId : string ; deviceId : string } [ ] ,
@@ -511,18 +503,6 @@ export class RoomWidgetClient extends MatrixClient {
511503 . catch ( timeoutToConnectionError ) ;
512504 }
513505
514- public async encryptAndSendToDevices ( userDeviceInfoArr : OlmDevice [ ] , payload : object ) : Promise < void > {
515- // map: user Id → device Id → payload
516- const contentMap : MapWithDefault < string , Map < string , object > > = new MapWithDefault ( ( ) => new Map ( ) ) ;
517- for ( const { userId, deviceId } of userDeviceInfoArr ) {
518- contentMap . getOrCreate ( userId ) . set ( deviceId , payload ) ;
519- }
520-
521- await this . widgetApi
522- . sendToDevice ( ( payload as { type : string } ) . type , true , recursiveMapToObject ( contentMap ) )
523- . catch ( timeoutToConnectionError ) ;
524- }
525-
526506 /**
527507 * Send an event to a specific list of devices via the widget API. Optionally encrypts the event.
528508 *
0 commit comments