1
0
Fork 0
mirror of https://forgejo.ellis.link/continuwuation/continuwuity.git synced 2025-08-04 11:43:58 +00:00

Support optional device_id's in lazy-loading context.

Co-authored-by: Jade Ellis <jade@ellis.link>
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2025-04-28 01:32:13 +00:00 committed by Jade Ellis
parent 49f7a2487f
commit 2051c22a28
No known key found for this signature in database
GPG key ID: 8705A2A3EBF77BD2
4 changed files with 17 additions and 19 deletions

View file

@ -27,7 +27,7 @@ pub trait Options: Send + Sync {
#[derive(Clone, Debug)]
pub struct Context<'a> {
pub user_id: &'a UserId,
pub device_id: &'a DeviceId,
pub device_id: Option<&'a DeviceId>,
pub room_id: &'a RoomId,
pub token: Option<u64>,
pub options: Option<&'a LazyLoadOptions>,
@ -40,7 +40,7 @@ pub enum Status {
}
pub type Witness = HashSet<OwnedUserId>;
type Key<'a> = (&'a UserId, &'a DeviceId, &'a RoomId, &'a UserId);
type Key<'a> = (&'a UserId, Option<&'a DeviceId>, &'a RoomId, &'a UserId);
impl crate::Service for Service {
fn build(args: crate::Args<'_>) -> Result<Arc<Self>> {