avatar fixes and implementation to edit

This commit is contained in:
Evan Carroll 2026-01-17 01:11:05 -06:00
parent acab2f017d
commit c3320ddcce
11 changed files with 1417 additions and 37 deletions

View file

@ -466,6 +466,37 @@ async fn handle_socket(
}
}
}
ClientMessage::SyncAvatar => {
// Fetch current avatar from database and broadcast to channel
match avatars::get_avatar_with_paths_conn(
&mut *recv_conn,
user_id,
realm_id,
)
.await
{
Ok(Some(avatar_with_paths)) => {
let render_data = avatar_with_paths.to_render_data();
#[cfg(debug_assertions)]
tracing::debug!(
"[WS] User {} syncing avatar to channel",
user_id
);
let _ = tx.send(ServerMessage::AvatarUpdated {
user_id: Some(user_id),
guest_session_id: None,
avatar: render_data,
});
}
Ok(None) => {
#[cfg(debug_assertions)]
tracing::warn!("[WS] No avatar found for user {} to sync", user_id);
}
Err(e) => {
tracing::error!("[WS] Avatar sync failed: {:?}", e);
}
}
}
}
}
}