refactor: Allow for client identities with no user ID

This commit is contained in:
Ginger committed 2026-05-27 12:15:16 -04:00
1 parent 30c9d6d2df
commit d7a51c7107
57 files changed
+212 -185

No files matched your search

+2 -2
View File
@@ -181,7 +181,7 @@ pub(crate) async fn sync_events_route(
ClientIp(client_ip): ClientIp,
body: Ruma<sync_events::v3::Request>,
) -> Result<sync_events::v3::Response> {
let sender_user = body.identity.sender_user();
let sender_user = body.identity.expect_sender_user()?;
let sender_device = body.identity.expect_sender_device()?;
// Presence update
@@ -226,7 +226,7 @@ pub(crate) async fn build_sync_events(
services: &Services,
body: &Ruma<sync_events::v3::Request>,
) -> Result<sync_events::v3::Response> {
let syncing_user = body.identity.sender_user();
let syncing_user = body.identity.sender_user().expect("should have a user");
let syncing_device = body.identity.sender_device().expect("should have a device");
let current_count = services.globals.current_count()?;
+1 -1
View File
@@ -70,7 +70,7 @@ pub(crate) async fn sync_events_v5_route(
body: Ruma<sync_events::v5::Request>,
) -> Result<sync_events::v5::Response> {
debug_assert!(DEFAULT_BUMP_TYPES.is_sorted(), "DEFAULT_BUMP_TYPES is not sorted");
let sender_user = body.identity.sender_user();
let sender_user = body.identity.expect_sender_user()?;
let sender_device = body.identity.expect_sender_device()?;
services