crypto: Recreate group sessions if they are expired.

This commit is contained in:
Damir Jelić 2020-04-10 09:58:13 +02:00
parent 0215e89ff8
commit c5f7af9118

View file

@ -935,6 +935,18 @@ impl OlmMachine {
}
let megolm_session = self.outbound_group_session.get(room_id).unwrap();
let megolm_session = if megolm_session.expired() {
self.create_outbound_group_session(room_id).await?;
self.outbound_group_session.get(room_id).unwrap()
} else {
megolm_session
};
if megolm_session.shared() {
panic!("Session is already shared");
}
let session_id = megolm_session.session_id().to_owned();
megolm_session.mark_as_shared();