diff --git a/crates/projection-irc/src/lib.rs b/crates/projection-irc/src/lib.rs index 0ce120e..b341ba8 100644 --- a/crates/projection-irc/src/lib.rs +++ b/crates/projection-irc/src/lib.rs @@ -894,11 +894,11 @@ async fn handle_incoming_message( .await?; } writer.flush().await?; - } else { - log::warn!( - "Requested chat history for user {user:?} even though the capability was not negotiated" - ); } + } else { + log::warn!( + "Requested chat history for user {user:?} even though the capability was not negotiated" + ); } } cmd => { diff --git a/crates/projection-irc/tests/lib.rs b/crates/projection-irc/tests/lib.rs index 34ae05f..baf728b 100644 --- a/crates/projection-irc/tests/lib.rs +++ b/crates/projection-irc/tests/lib.rs @@ -200,9 +200,14 @@ async fn scenario_basic_with_chathistory() -> Result<()> { let mut stream = TcpStream::connect(server.server.addr).await?; let mut s = TestScope::new(&mut stream); - s.send("PASS password").await?; s.send("NICK tester").await?; + s.send("CAP REQ :draft/chathistory").await?; s.send("USER UserName 0 * :Real Name").await?; + s.send("PASS password").await?; + s.send("USER UserName 0 * :Real Name").await?; + s.expect(":testserver CAP tester ACK :draft/chathistory").await?; + s.send("CAP END").await?; + s.expect_server_introduction("tester").await?; s.expect_nothing().await?; @@ -211,6 +216,7 @@ async fn scenario_basic_with_chathistory() -> Result<()> { s.expect(":testserver 332 tester #test :New room").await?; s.expect(":testserver 353 tester = #test :tester").await?; s.expect(":testserver 366 tester #test :End of /NAMES list").await?; + s.send("PRIVMSG #test :Message1").await?; s.send("PRIVMSG #test :Message2").await?; s.send("PRIVMSG #test :Message3").await?;