1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-31 09:24:31 +03:00

Fully sync the devices with the homeserver

This commit is contained in:
Quentin Gliech
2024-07-12 18:14:26 +02:00
parent fbc360d1a9
commit bf276289b6
10 changed files with 263 additions and 65 deletions

View File

@ -394,6 +394,31 @@ mod jobs {
const NAME: &'static str = "delete-device";
}
/// A job which syncs the list of devices of a user with the homeserver
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct SyncDevicesJob {
user_id: Ulid,
}
impl SyncDevicesJob {
/// Create a new job to sync the list of devices of a user with the
/// homeserver
#[must_use]
pub fn new(user: &User) -> Self {
Self { user_id: user.id }
}
/// The ID of the user to sync the devices for
#[must_use]
pub fn user_id(&self) -> Ulid {
self.user_id
}
}
impl Job for SyncDevicesJob {
const NAME: &'static str = "sync-devices";
}
/// A job to deactivate and lock a user
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct DeactivateUserJob {
@ -468,5 +493,5 @@ mod jobs {
pub use self::jobs::{
DeactivateUserJob, DeleteDeviceJob, ProvisionDeviceJob, ProvisionUserJob,
SendAccountRecoveryEmailsJob, VerifyEmailJob,
SendAccountRecoveryEmailsJob, SyncDevicesJob, VerifyEmailJob,
};