chore: Allow some usage of deprecated fields

… to allow CI to succeed. They should be removed soon.
This commit is contained in:
Jonas Platte
2022-06-23 13:32:19 +02:00
committed by Jonas Platte
parent f20d1c3d76
commit cffb565a5f
5 changed files with 32 additions and 5 deletions
@@ -343,6 +343,7 @@ impl GossipMachine {
.store
.get_inbound_group_session(
&key_info.room_id,
#[allow(deprecated)]
&key_info.sender_key,
&key_info.session_id,
)
@@ -89,6 +89,7 @@ impl SecretInfo {
/// comparison
pub fn as_key(&self) -> String {
match &self {
#[allow(deprecated)]
SecretInfo::KeyRequest(ref info) => format!(
"keyRequest:{:}:{:}:{:}:{:}",
info.room_id.as_str(),
+27 -5
View File
@@ -1002,7 +1002,12 @@ impl OlmMachine {
Ok(self
.key_request_machine
.request_key(room_id, &content.sender_key, &content.session_id)
.request_key(
room_id,
#[allow(deprecated)]
&content.sender_key,
&content.session_id,
)
.await?)
}
@@ -1050,7 +1055,12 @@ impl OlmMachine {
) -> MegolmResult<RoomEvent> {
if let Some(session) = self
.store
.get_inbound_group_session(room_id, &content.sender_key, &content.session_id)
.get_inbound_group_session(
room_id,
#[allow(deprecated)]
&content.sender_key,
&content.session_id,
)
.await?
{
// TODO check the message index.
@@ -1084,13 +1094,24 @@ impl OlmMachine {
}
}
let encryption_info =
self.get_encryption_info(&session, &event.sender, &content.device_id).await?;
let encryption_info = self
.get_encryption_info(
&session,
&event.sender,
#[allow(deprecated)]
&content.device_id,
)
.await?;
Ok(RoomEvent { encryption_info: Some(encryption_info), event: decrypted_event })
} else {
self.key_request_machine
.create_outgoing_key_request(room_id, &content.sender_key, &content.session_id)
.create_outgoing_key_request(
room_id,
#[allow(deprecated)]
&content.sender_key,
&content.session_id,
)
.await?;
Err(MegolmError::MissingRoomKey)
@@ -1114,6 +1135,7 @@ impl OlmMachine {
match self.decrypt_megolm_v1_event(room_id, event, c).await {
Ok(r) => Ok(r),
Err(e) => {
#[allow(deprecated)]
if let MegolmError::MissingRoomKey = e {
// TODO log the withheld reason if we have one.
debug!(
@@ -37,6 +37,7 @@ use crate::{
fn encode_key_info(info: &SecretInfo) -> String {
match info {
#[allow(deprecated)]
SecretInfo::KeyRequest(info) => {
format!("{}{}{}{}", info.room_id, info.sender_key, info.algorithm, info.session_id)
}
@@ -118,10 +118,12 @@ impl EncodeKey for SecretInfo {
impl EncodeKey for RequestedKeyInfo {
fn encode(&self) -> Vec<u8> {
#[allow(deprecated)]
(&self.room_id, &self.sender_key, &self.algorithm, &self.session_id).encode()
}
fn encode_secure(&self, table_name: &str, store_cipher: &StoreCipher) -> Vec<u8> {
let room_id = store_cipher.hash_key(table_name, self.room_id.as_bytes());
#[allow(deprecated)]
let sender_key = store_cipher.hash_key(table_name, self.sender_key.as_bytes());
let algorithm = store_cipher.hash_key(table_name, self.algorithm.as_ref().as_bytes());
let session_id = store_cipher.hash_key(table_name, self.session_id.as_bytes());