From 5c94caa3bbcac2819bcbced6d267d443340ef614 Mon Sep 17 00:00:00 2001 From: strawberry Date: Fri, 8 Mar 2024 17:56:54 -0500 Subject: [PATCH] temp: dont fetch remote profiles for remote membership updates Signed-off-by: strawberry --- src/service/rooms/state_cache/mod.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/service/rooms/state_cache/mod.rs b/src/service/rooms/state_cache/mod.rs index 0ce82e1f..65e45926 100644 --- a/src/service/rooms/state_cache/mod.rs +++ b/src/service/rooms/state_cache/mod.rs @@ -2,7 +2,6 @@ use std::{collections::HashSet, sync::Arc}; pub use data::Data; use ruma::{ - api::federation, events::{ direct::DirectEvent, ignored_user_list::IgnoredUserListEvent, @@ -35,11 +34,16 @@ impl Service { let membership = membership_event.membership; // Keep track what remote users exist by adding them as "deactivated" users + // + // TODO: use futures to update remote profiles without blocking the membership + // update + #[allow(clippy::collapsible_if)] if user_id.server_name() != services().globals.server_name() { if !services().users.exists(user_id)? { services().users.create(user_id, None)?; } + /* // Try to update our local copy of the user if ours does not match if ((services().users.displayname(user_id)? != membership_event.displayname) || (services().users.avatar_url(user_id)? != membership_event.avatar_url) @@ -55,12 +59,13 @@ impl Service { field: None, // we want the full user's profile to update locally too }, ) - .await?; + .await; services().users.set_displayname(user_id, response.displayname.clone()).await?; services().users.set_avatar_url(user_id, response.avatar_url).await?; services().users.set_blurhash(user_id, response.blurhash).await?; }; + */ } match &membership {