forked from lavina/lavina
Handle non-negotiated cap
This commit is contained in:
parent
a3e41ad11d
commit
ae0464b742
|
@ -27,8 +27,11 @@ use proto_irc::server::{AwayStatus, ServerMessage, ServerMessageBody};
|
|||
use proto_irc::user::PrefixedNick;
|
||||
use proto_irc::{Chan, Recipient, Tag};
|
||||
use sasl::AuthBody;
|
||||
|
||||
mod cap;
|
||||
|
||||
use handler::Handler;
|
||||
|
||||
mod whois;
|
||||
|
||||
use crate::cap::Capabilities;
|
||||
|
@ -861,6 +864,7 @@ async fn handle_incoming_message(
|
|||
return Ok(HandleResult::Leave);
|
||||
}
|
||||
ClientMessage::ChatHistory { chan, limit } => {
|
||||
if user.enabled_capabilities.contains(Capabilities::ChatHistory) {
|
||||
let channel_name = match chan.clone() {
|
||||
Chan::Global(chan) => chan,
|
||||
Chan::Local(chan) => chan,
|
||||
|
@ -890,6 +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"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
cmd => {
|
||||
|
|
Loading…
Reference in New Issue