BlueGit

ict rusty-teams

fix(calls): naam van de beller uit je chats als de belpush er geen heeft; foto in de Linux-belmelding zodra die binnen is

hephaestus

Authored 2026-12-02 · 1 day ago

Hash
74a0dce6172fb2d3ce3504efed49d8228491fe39
Parent
3e624f42
3 files changed +24 −2
crates/app-state/src/call/actions.rs +9 −1
@@ -1210,12 +1210,20 @@ impl AppState {
1210 1210 }
1211 1211 }
1212 1212
1213 fn push_ring(&mut self, ring: calling::IncomingRing, demo: bool, cx: &mut Context<Self>) {
1213 fn push_ring(&mut self, mut ring: calling::IncomingRing, demo: bool, cx: &mut Context<Self>) {
1214 1214 let caller_user_id = ring
1215 1215 .caller
1216 1216 .mri
1217 1217 .strip_prefix(ORGID_PREFIX)
1218 1218 .map(str::to_owned);
1219 // KVT: zonder displayName in de push de naam uit je chats, zoals de gesprekkenlijst.
1220 if ring.caller.display_name.trim().is_empty()
1221 && let Some(name) = caller_user_id
1222 .as_deref()
1223 .and_then(|user_id| self.member_name(user_id))
1224 {
1225 ring.caller.display_name = name;
1226 }
1219 1227 self.rings.push(ring, demo, Instant::now());
1220 1228 if let Some(user_id) = caller_user_id {
1221 1229 self.request_avatars(vec![user_id], cx);
@@ -1210,12 +1210,20 @@ impl AppState {
1210 }
1210 }
1211 }
1211 }
1212
1212
1213 fn push_ring(&mut self, ring: calling::IncomingRing, demo: bool, cx: &mut Context<Self>) {
1213 fn push_ring(&mut self, mut ring: calling::IncomingRing, demo: bool, cx: &mut Context<Self>) {
1214 let caller_user_id = ring
1214 let caller_user_id = ring
1215 .caller
1215 .caller
1216 .mri
1216 .mri
1217 .strip_prefix(ORGID_PREFIX)
1217 .strip_prefix(ORGID_PREFIX)
1218 .map(str::to_owned);
1218 .map(str::to_owned);
1219 // KVT: zonder displayName in de push de naam uit je chats, zoals de gesprekkenlijst.
1220 if ring.caller.display_name.trim().is_empty()
1221 && let Some(name) = caller_user_id
1222 .as_deref()
1223 .and_then(|user_id| self.member_name(user_id))
1224 {
1225 ring.caller.display_name = name;
1226 }
1219 self.rings.push(ring, demo, Instant::now());
1227 self.rings.push(ring, demo, Instant::now());
1220 if let Some(user_id) = caller_user_id {
1228 if let Some(user_id) = caller_user_id {
1221 self.request_avatars(vec![user_id], cx);
1229 self.request_avatars(vec![user_id], cx);
crates/app-state/src/call/history.rs +7 −0
@@ -258,6 +258,13 @@ impl AppState {
258 258 .detach();
259 259 }
260 260
261 /// Naam van iemand uit de leden van je chats (zoals de gesprekkenlijst die vindt).
262 pub fn member_name(&self, user_id: &str) -> Option<String> {
263 known_names(&self.sidebar.chats)
264 .get(user_id)
265 .map(|name| (*name).to_owned())
266 }
267
261 268 pub fn one_on_one_chat_with(&self, user_id: &str) -> Option<String> {
262 269 self.sidebar
263 270 .chats
@@ -258,6 +258,13 @@ impl AppState {
258 .detach();
258 .detach();
259 }
259 }
260
260
261 /// Naam van iemand uit de leden van je chats (zoals de gesprekkenlijst die vindt).
262 pub fn member_name(&self, user_id: &str) -> Option<String> {
263 known_names(&self.sidebar.chats)
264 .get(user_id)
265 .map(|name| (*name).to_owned())
266 }
267
261 pub fn one_on_one_chat_with(&self, user_id: &str) -> Option<String> {
268 pub fn one_on_one_chat_with(&self, user_id: &str) -> Option<String> {
262 self.sidebar
269 self.sidebar
263 .chats
270 .chats
crates/app/src/notify/center.rs +8 −1
@@ -455,7 +455,14 @@ impl NotificationCenter {
455 455 AppEvent::Messages(conversation_id) => self.on_messages(conversation_id, cx),
456 456 AppEvent::Selection => self.on_selection(cx),
457 457 AppEvent::Sidebar => self.refresh_badge(cx),
458 AppEvent::Directory | AppEvent::Status => self.sync_tray(cx),
458 AppEvent::Directory | AppEvent::Status => {
459 self.sync_tray(cx);
460 // KVT: de foto van de beller komt vaak pas na de belmelding binnen.
461 #[cfg(target_os = "linux")]
462 if self.app.read(cx).rings.is_ringing() {
463 self.sync_desktop(cx);
464 }
465 }
459 466 AppEvent::Ring => self.on_rings_changed(cx),
460 467 AppEvent::MeetingReminder => self.on_meeting_reminder(cx),
461 468 AppEvent::MeetingChime => self.on_meeting_chime(cx),
@@ -455,7 +455,14 @@ impl NotificationCenter {
455 AppEvent::Messages(conversation_id) => self.on_messages(conversation_id, cx),
455 AppEvent::Messages(conversation_id) => self.on_messages(conversation_id, cx),
456 AppEvent::Selection => self.on_selection(cx),
456 AppEvent::Selection => self.on_selection(cx),
457 AppEvent::Sidebar => self.refresh_badge(cx),
457 AppEvent::Sidebar => self.refresh_badge(cx),
458 AppEvent::Directory | AppEvent::Status => self.sync_tray(cx),
458 AppEvent::Directory | AppEvent::Status => {
459 self.sync_tray(cx);
460 // KVT: de foto van de beller komt vaak pas na de belmelding binnen.
461 #[cfg(target_os = "linux")]
462 if self.app.read(cx).rings.is_ringing() {
463 self.sync_desktop(cx);
464 }
465 }
459 AppEvent::Ring => self.on_rings_changed(cx),
466 AppEvent::Ring => self.on_rings_changed(cx),
460 AppEvent::MeetingReminder => self.on_meeting_reminder(cx),
467 AppEvent::MeetingReminder => self.on_meeting_reminder(cx),
461 AppEvent::MeetingChime => self.on_meeting_chime(cx),
468 AppEvent::MeetingChime => self.on_meeting_chime(cx),