BlueGit

ict rusty-teams

Merge pull request #2 from jubacCH/fix/external-profile-cards

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

metis Daniel Däschle · pushed by metis

Authored 2026-11-01 · 4 weeks ago

Hash
96a0b9eaa05edd02c018692ad69c6e4f02ba4259
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