fix: preserve original relay label through multi-hop presence propagation
When propagating GlobalRoomActive to other peers, use tagged participants (with relay_label set to the originating relay) instead of the raw untagged participants. This shows "Relay C" instead of "Relay B" when C's participants are forwarded through hub B to A. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -675,12 +675,24 @@ async fn handle_signal(
|
|||||||
}).collect();
|
}).collect();
|
||||||
link.remote_participants.insert(room.clone(), tagged);
|
link.remote_participants.insert(room.clone(), tagged);
|
||||||
}
|
}
|
||||||
// Propagate to other peers
|
// Propagate to other peers (with relay labels preserved)
|
||||||
|
let tagged_for_propagation = if let Some(link) = links.get(peer_fp) {
|
||||||
|
let label = link.label.clone();
|
||||||
|
participants.iter().map(|p| {
|
||||||
|
let mut t = p.clone();
|
||||||
|
if t.relay_label.is_none() {
|
||||||
|
t.relay_label = Some(label.clone());
|
||||||
|
}
|
||||||
|
t
|
||||||
|
}).collect::<Vec<_>>()
|
||||||
|
} else {
|
||||||
|
participants.clone()
|
||||||
|
};
|
||||||
for (fp, link) in links.iter() {
|
for (fp, link) in links.iter() {
|
||||||
if fp != peer_fp {
|
if fp != peer_fp {
|
||||||
let _ = link.transport.send_signal(&SignalMessage::GlobalRoomActive {
|
let _ = link.transport.send_signal(&SignalMessage::GlobalRoomActive {
|
||||||
room: room.clone(),
|
room: room.clone(),
|
||||||
participants: participants.clone(),
|
participants: tagged_for_propagation.clone(),
|
||||||
}).await;
|
}).await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user