mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-07 15:33:45 -04:00
fix(crypto-ffi): Allow room message requests to be marked as sent
This commit is contained in:
@@ -25,6 +25,7 @@ use ruma::{
|
||||
upload_keys::v3::Response as KeysUploadResponse,
|
||||
upload_signatures::v3::Response as SignatureUploadResponse,
|
||||
},
|
||||
message::send_message_event::v3::Response as RoomMessageResponse,
|
||||
sync::sync_events::v3::{DeviceLists as RumaDeviceLists, ToDevice},
|
||||
to_device::send_event_to_device::v3::Response as ToDeviceResponse,
|
||||
},
|
||||
@@ -330,6 +331,9 @@ impl OlmMachine {
|
||||
RequestType::KeysBackup => {
|
||||
KeysBackupResponse::try_from_http_response(response).map(Into::into)
|
||||
}
|
||||
RequestType::RoomMessage => {
|
||||
RoomMessageResponse::try_from_http_response(response).map(Into::into)
|
||||
}
|
||||
}
|
||||
.expect("Can't convert json string to response");
|
||||
|
||||
|
||||
@@ -244,6 +244,7 @@ enum RequestType {
|
||||
"ToDevice",
|
||||
"SignatureUpload",
|
||||
"KeysBackup",
|
||||
"RoomMessage",
|
||||
};
|
||||
|
||||
interface OlmMachine {
|
||||
|
||||
@@ -18,6 +18,7 @@ use ruma::{
|
||||
Request as RustSignatureUploadRequest, Response as SignatureUploadResponse,
|
||||
},
|
||||
},
|
||||
message::send_message_event::v3::Response as RoomMessageResponse,
|
||||
sync::sync_events::v3::DeviceLists as RumaDeviceLists,
|
||||
to_device::send_event_to_device::v3::Response as ToDeviceResponse,
|
||||
},
|
||||
@@ -226,6 +227,7 @@ pub enum RequestType {
|
||||
ToDevice,
|
||||
SignatureUpload,
|
||||
KeysBackup,
|
||||
RoomMessage,
|
||||
}
|
||||
|
||||
pub struct DeviceLists {
|
||||
@@ -269,6 +271,7 @@ pub(crate) enum OwnedResponse {
|
||||
ToDevice(ToDeviceResponse),
|
||||
SignatureUpload(SignatureUploadResponse),
|
||||
KeysBackup(KeysBackupResponse),
|
||||
RoomMessage(RoomMessageResponse),
|
||||
}
|
||||
|
||||
impl From<KeysClaimResponse> for OwnedResponse {
|
||||
@@ -307,6 +310,12 @@ impl From<KeysBackupResponse> for OwnedResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<RoomMessageResponse> for OwnedResponse {
|
||||
fn from(response: RoomMessageResponse) -> Self {
|
||||
OwnedResponse::RoomMessage(response)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a OwnedResponse> for IncomingResponse<'a> {
|
||||
fn from(r: &'a OwnedResponse) -> Self {
|
||||
match r {
|
||||
@@ -316,6 +325,7 @@ impl<'a> From<&'a OwnedResponse> for IncomingResponse<'a> {
|
||||
OwnedResponse::ToDevice(r) => IncomingResponse::ToDevice(r),
|
||||
OwnedResponse::SignatureUpload(r) => IncomingResponse::SignatureUpload(r),
|
||||
OwnedResponse::KeysBackup(r) => IncomingResponse::KeysBackup(r),
|
||||
OwnedResponse::RoomMessage(r) => IncomingResponse::RoomMessage(r),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user