diff --git a/crates/mind-body/src/projection/select.rs b/crates/mind-body/src/projection/select.rs index 01296f6..2a3a09f 100644 --- a/crates/mind-body/src/projection/select.rs +++ b/crates/mind-body/src/projection/select.rs @@ -1392,7 +1392,7 @@ fn turned_to_her(inputs: &Inputs) -> Vec<(String, String)> { out.push((person, if Some(line.room.as_str()) == here { "here".to_owned() } else { format!("in {}", line.room) })); } } - for line in inputs.room.elsewhere.iter().filter(|line| line.sender != inputs.people.own_sender).rev() { + for line in inputs.room.elsewhere.iter().filter(|line| line.to_her && line.sender != inputs.people.own_sender).rev() { let person = inputs.people.person_of(&line.sender); if !out.iter().any(|(id, _)| *id == person) { out.push((person, format!("in {}, {}", line.room, coarse_ms(inputs.now, line.at_ms)))); diff --git a/crates/mind-body/src/projection/tests.rs b/crates/mind-body/src/projection/tests.rs index 5805f60..95813a1 100644 --- a/crates/mind-body/src/projection/tests.rs +++ b/crates/mind-body/src/projection/tests.rs @@ -2177,6 +2177,21 @@ fn k21_whoever_turned_to_her_does_so_on_their_own_line() { assert!(!packet.context.contains("Kiko turned") && !packet.context.contains("Kiko, who turned") && !packet.context.contains("just now:"), "{}", packet.context); } +/// The same arrival rule in her other waking rooms: a line there that is not to her (it named another Mind) gives its sender +/// no arrival; one that is to her does, "in" that room. +#[test] +fn k21_another_rooms_line_not_to_her_is_no_arrival() { + let room = Room { + messages: vec![message("#swarm:gamecult.org", OPERATOR, "Meta", "Eureka, are you around?", 3, true)], + elsewhere: vec![message("#aetheria:gamecult.org", "@deru:gamecult.org", "Deru", "Kiko, the build?", 2, false), message("#general:gamecult.org", "@ana:gamecult.org", "Ana", "Eureka, one thing", 1, true)], + here: Some("#swarm:gamecult.org".into()), + ..Room::default() + }; + let packet = packet_of(TurnKind::Chat, &state(), &room, &History::default(), 1); + assert!(!packet.context.contains("in #aetheria:gamecult.org"), "a line for another Mind is no arrival: {}", packet.context); + assert!(packet.context.contains("who turned to her just now, in #general:gamecult.org") && packet.context.matches("who turned to her").count() == 1, "a line to her elsewhere is, and only it: {}", packet.context); +} + /// Map 16.21's negative check: outside the frame's no-furnishing sentence and the notes, the Projector's prompt says /// nothing of speech or of what is unknown. Also exempt, as about her own idiom and the budget and never the arrival: the /// voice heading, the frame's idiom sentence and the word budget ("words").