@@ -85,6 +85,7 @@ use crate::{
85
85
RoomEventEncryptionScheme , SupportedEventEncryptionSchemes ,
86
86
} ,
87
87
room_key:: { MegolmV1AesSha2Content , RoomKeyContent } ,
88
+ room_key_bundle:: RoomKeyBundleContent ,
88
89
room_key_withheld:: {
89
90
MegolmV1AesSha2WithheldContent , RoomKeyWithheldContent , RoomKeyWithheldEvent ,
90
91
} ,
@@ -98,8 +99,8 @@ use crate::{
98
99
} ,
99
100
utilities:: timestamp_to_iso8601,
100
101
verification:: { Verification , VerificationMachine , VerificationRequest } ,
101
- CrossSigningKeyExport , CryptoStoreError , DecryptionSettings , DeviceData , LocalTrust ,
102
- RoomEventDecryptionResult , SignatureError , TrustRequirement ,
102
+ CollectStrategy , CrossSigningKeyExport , CryptoStoreError , DecryptionSettings , DeviceData ,
103
+ LocalTrust , RoomEventDecryptionResult , SignatureError , TrustRequirement ,
103
104
} ;
104
105
105
106
/// State machine implementation of the Olm/Megolm encryption protocol used for
@@ -1089,6 +1090,22 @@ impl OlmMachine {
1089
1090
self . inner . group_session_manager . share_room_key ( room_id, users, encryption_settings) . await
1090
1091
}
1091
1092
1093
+ /// Collect the devices belonging to the given user, and send the details of
1094
+ /// a room key bundle to those devices.
1095
+ ///
1096
+ /// Returns a list of to-device requests which must be sent.
1097
+ pub async fn share_room_key_bundle_data (
1098
+ & self ,
1099
+ user_id : & UserId ,
1100
+ collect_strategy : & CollectStrategy ,
1101
+ bundle_data : RoomKeyBundleContent ,
1102
+ ) -> OlmResult < Vec < ToDeviceRequest > > {
1103
+ self . inner
1104
+ . group_session_manager
1105
+ . share_room_key_bundle_data ( user_id, collect_strategy, bundle_data)
1106
+ . await
1107
+ }
1108
+
1092
1109
/// Receive an unencrypted verification event.
1093
1110
///
1094
1111
/// This method can be used to pass verification events that are happening
0 commit comments