forked from lavina/lavina
Handle cap correctly and test
This commit is contained in:
parent
dfc28148e5
commit
ba26e833e4
|
@ -894,13 +894,13 @@ 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"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
cmd => {
|
||||
log::warn!("Not implemented handler for client command: {cmd:?}");
|
||||
}
|
||||
|
|
|
@ -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?;
|
||||
|
|
Loading…
Reference in New Issue