feat(w7): cosmetic room labels carried in the ticket (P5)
Rooms can now be named. A "Room name (optional)" field on the home Create card mints a ticket carrying the label; PeerSpeakTicket gains a #[serde(default)] `name` field (backward/forward compatible — serde ignores unknown fields and defaults missing ones, so old/new builds still interoperate, just without labels). restamp preserves the label so member-issued doors keep it; new label_of helper reads it. Every member (creator or joiner) sets current_room.name from the ticket, so presence reports a consistent "in <name>" to friends, and the room-screen header shows the label under the wordmark. Labels are sanitized via sanitize_name on both mint and display (untrusted peer-supplied ticket). CoreCommand::Join gains room_name (used only when creating). +2 ticket tests (label round-trip through restamp/label_of, pre-label backward-compat). clippy --all-targets clean, 257 lib tests green. Pure seam unit-tested + home field screenshot-verified; the in-room header label and friend-side "in HangOut" presence display need a live/2-machine confirm. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+6
-1
@@ -145,7 +145,12 @@ mod tests {
|
||||
}
|
||||
|
||||
fn valid_ticket(for_id: EndpointId) -> String {
|
||||
PeerSpeakTicket { host_addr: EndpointAddr::from(for_id), topic_id: [9u8; 32] }.to_string()
|
||||
PeerSpeakTicket {
|
||||
host_addr: EndpointAddr::from(for_id),
|
||||
topic_id: [9u8; 32],
|
||||
name: String::new(),
|
||||
}
|
||||
.to_string()
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user