@@ -62,17 +62,6 @@ interface IStateEventRequest {
62
62
stateKey ?: string ;
63
63
}
64
64
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
-
76
65
export interface ICapabilities {
77
66
/**
78
67
* Event types that this client expects to send.
@@ -464,6 +453,9 @@ export class RoomWidgetClient extends MatrixClient {
464
453
return { } ;
465
454
}
466
455
456
+ /**
457
+ * by {@link MatrixClient.encryptAndSendToDevice}.
458
+ */
467
459
public async encryptAndSendToDevice (
468
460
eventType : string ,
469
461
devices : { userId : string ; deviceId : string } [ ] ,
@@ -511,18 +503,6 @@ export class RoomWidgetClient extends MatrixClient {
511
503
. catch ( timeoutToConnectionError ) ;
512
504
}
513
505
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
-
526
506
/**
527
507
* Send an event to a specific list of devices via the widget API. Optionally encrypts the event.
528
508
*
0 commit comments