1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2025-10-15 19:42:07 +00:00

chore: upgrade ruma

This commit is contained in:
Matthias Ahouansou 2025-02-23 05:35:28 +00:00
parent 406367b4f2
commit 2a7aa6242f
No known key found for this signature in database
14 changed files with 143 additions and 144 deletions

View file

@ -230,7 +230,7 @@ impl Service {
let event_id_only = http.format == Some(PushFormat::EventIdOnly);
let mut device = Device::new(pusher.ids.app_id.clone(), pusher.ids.pushkey.clone());
device.data.default_payload = http.default_payload.clone();
device.data.data = http.data.clone();
device.data.format.clone_from(&http.format);
// Tweaks are only added if the format is NOT event_id_only

View file

@ -498,6 +498,8 @@ impl Service {
)
})?,
appservice::event::push_events::v1::Request {
//TODO: ephemeral pushing
ephemeral: Vec::new(),
events: pdu_jsons,
txn_id: (&*general_purpose::URL_SAFE_NO_PAD.encode(calculate_hash(
&events

View file

@ -4,8 +4,8 @@ use ruma::{
encryption::{CrossSigningKey, DeviceKeys, OneTimeKey},
events::AnyToDeviceEvent,
serde::Raw,
DeviceId, DeviceKeyAlgorithm, DeviceKeyId, OwnedDeviceId, OwnedDeviceKeyId, OwnedMxcUri,
OwnedUserId, UInt, UserId,
DeviceId, OneTimeKeyAlgorithm, OwnedDeviceId, OwnedMxcUri, OwnedOneTimeKeyId, OwnedUserId,
UInt, UserId,
};
use std::collections::BTreeMap;
@ -79,7 +79,7 @@ pub trait Data: Send + Sync {
&self,
user_id: &UserId,
device_id: &DeviceId,
one_time_key_key: &DeviceKeyId,
one_time_key_key: &OwnedOneTimeKeyId,
one_time_key_value: &Raw<OneTimeKey>,
) -> Result<()>;
@ -89,14 +89,14 @@ pub trait Data: Send + Sync {
&self,
user_id: &UserId,
device_id: &DeviceId,
key_algorithm: &DeviceKeyAlgorithm,
) -> Result<Option<(OwnedDeviceKeyId, Raw<OneTimeKey>)>>;
key_algorithm: &OneTimeKeyAlgorithm,
) -> Result<Option<(OwnedOneTimeKeyId, Raw<OneTimeKey>)>>;
fn count_one_time_keys(
&self,
user_id: &UserId,
device_id: &DeviceId,
) -> Result<BTreeMap<DeviceKeyAlgorithm, UInt>>;
) -> Result<BTreeMap<OneTimeKeyAlgorithm, UInt>>;
fn add_device_keys(
&self,

View file

@ -18,8 +18,8 @@ use ruma::{
encryption::{CrossSigningKey, DeviceKeys, OneTimeKey},
events::AnyToDeviceEvent,
serde::Raw,
DeviceId, DeviceKeyAlgorithm, DeviceKeyId, OwnedDeviceId, OwnedDeviceKeyId, OwnedMxcUri,
OwnedRoomId, OwnedUserId, UInt, UserId,
DeviceId, OneTimeKeyAlgorithm, OwnedDeviceId, OwnedMxcUri, OwnedOneTimeKeyId, OwnedRoomId,
OwnedUserId, UInt, UserId,
};
use crate::{services, Error, Result};
@ -373,7 +373,7 @@ impl Service {
&self,
user_id: &UserId,
device_id: &DeviceId,
one_time_key_key: &DeviceKeyId,
one_time_key_key: &OwnedOneTimeKeyId,
one_time_key_value: &Raw<OneTimeKey>,
) -> Result<()> {
self.db
@ -388,8 +388,8 @@ impl Service {
&self,
user_id: &UserId,
device_id: &DeviceId,
key_algorithm: &DeviceKeyAlgorithm,
) -> Result<Option<(OwnedDeviceKeyId, Raw<OneTimeKey>)>> {
key_algorithm: &OneTimeKeyAlgorithm,
) -> Result<Option<(OwnedOneTimeKeyId, Raw<OneTimeKey>)>> {
self.db.take_one_time_key(user_id, device_id, key_algorithm)
}
@ -397,7 +397,7 @@ impl Service {
&self,
user_id: &UserId,
device_id: &DeviceId,
) -> Result<BTreeMap<DeviceKeyAlgorithm, UInt>> {
) -> Result<BTreeMap<OneTimeKeyAlgorithm, UInt>> {
self.db.count_one_time_keys(user_id, device_id)
}