File tree 1 file changed +17
-2
lines changed
1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -74,8 +74,23 @@ export class RustCrypto implements CryptoBackend {
74
74
}
75
75
76
76
public async decryptEvent ( event : MatrixEvent ) : Promise < IEventDecryptionResult > {
77
- await this . olmMachine . decryptRoomEvent ( "event" , new RustSdkCryptoJs . RoomId ( "room" ) ) ;
78
- throw new Error ( "not implemented" ) ;
77
+ const res = ( await this . olmMachine . decryptRoomEvent (
78
+ JSON . stringify ( {
79
+ event_id : event . getId ( ) ,
80
+ type : event . getWireType ( ) ,
81
+ sender : event . getSender ( ) ,
82
+ state_key : event . getStateKey ( ) ,
83
+ content : event . getWireContent ( ) ,
84
+ origin_server_ts : event . getTs ( ) ,
85
+ } ) ,
86
+ new RustSdkCryptoJs . RoomId ( event . getRoomId ( ) ! ) ,
87
+ ) ) as DecryptedRoomEvent ;
88
+ return {
89
+ clearEvent : JSON . parse ( res . event ) ,
90
+ claimedEd25519Key : res . senderClaimedEd25519Key ,
91
+ senderCurve25519Key : res . senderCurve25519Key ,
92
+ forwardingCurve25519KeyChain : res . forwardingCurve25519KeyChain ,
93
+ } ;
79
94
}
80
95
81
96
public async userHasCrossSigningKeys ( ) : Promise < boolean > {
You can’t perform that action at this time.
0 commit comments