BlueGit

ict rusty-teams

fix(profile): cards of people from other organizations show their presence

Graph answers 404 for people outside the signed-in tenant, so their profile
card only showed "Profile details could not be loaded". Like Teams, the card
now builds without directory details and still shows availability, status
note and out of office from presence.

metis jubacCH · pushed by metis

Authored 2026-10-16 · 6 weeks ago

Hash
a41e34e370ce7e7e3c5683db8712dda168d06e0b
Parent
80c7b5b9
1 file changed +14 −1
crates/core/src/profile.rs +14 −1
@@ -70,7 +70,20 @@ impl PersonProfile {
70 70 }
71 71
72 72 pub(crate) async fn load_profile(graph: &Graph, user_id: &str) -> Result<PersonProfile> {
73 let details = graph.user_profile(user_id).await?;
73 let details = match graph.user_profile(user_id).await {
74 Ok(details) => details,
75 // People from other organizations are not in this directory. Like Teams, their card
76 // still shows what presence knows: availability, status note and out of office.
77 Err(graph::Error::Session(session::Error::Api { status: 404, .. })) => ProfileDetails {
78 user: graph::UserProfile {
79 id: user_id.to_owned(),
80 ..Default::default()
81 },
82 manager: None,
83 direct_reports: Vec::new(),
84 },
85 Err(error) => return Err(error.into()),
86 };
74 87 let mail = details
75 88 .user
76 89 .mail
@@ -70,7 +70,20 @@ impl PersonProfile {
70}
70}
71
71
72pub(crate) async fn load_profile(graph: &Graph, user_id: &str) -> Result<PersonProfile> {
72pub(crate) async fn load_profile(graph: &Graph, user_id: &str) -> Result<PersonProfile> {
73 let details = graph.user_profile(user_id).await?;
73 let details = match graph.user_profile(user_id).await {
74 Ok(details) => details,
75 // People from other organizations are not in this directory. Like Teams, their card
76 // still shows what presence knows: availability, status note and out of office.
77 Err(graph::Error::Session(session::Error::Api { status: 404, .. })) => ProfileDetails {
78 user: graph::UserProfile {
79 id: user_id.to_owned(),
80 ..Default::default()
81 },
82 manager: None,
83 direct_reports: Vec::new(),
84 },
85 Err(error) => return Err(error.into()),
86 };
74 let mail = details
87 let mail = details
75 .user
88 .user
76 .mail
89 .mail