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::user::PrefixedNick;
|
||||||
use proto_irc::{Chan, Recipient, Tag};
|
use proto_irc::{Chan, Recipient, Tag};
|
||||||
use sasl::AuthBody;
|
use sasl::AuthBody;
|
||||||
|
|
||||||
mod cap;
|
mod cap;
|
||||||
|
|
||||||
use handler::Handler;
|
use handler::Handler;
|
||||||
|
|
||||||
mod whois;
|
mod whois;
|
||||||
|
|
||||||
use crate::cap::Capabilities;
|
use crate::cap::Capabilities;
|
||||||
|
@ -861,6 +864,7 @@ async fn handle_incoming_message(
|
||||||
return Ok(HandleResult::Leave);
|
return Ok(HandleResult::Leave);
|
||||||
}
|
}
|
||||||
ClientMessage::ChatHistory { chan, limit } => {
|
ClientMessage::ChatHistory { chan, limit } => {
|
||||||
|
if user.enabled_capabilities.contains(Capabilities::ChatHistory) {
|
||||||
let channel_name = match chan.clone() {
|
let channel_name = match chan.clone() {
|
||||||
Chan::Global(chan) => chan,
|
Chan::Global(chan) => chan,
|
||||||
Chan::Local(chan) => chan,
|
Chan::Local(chan) => chan,
|
||||||
|
@ -890,6 +894,11 @@ async fn handle_incoming_message(
|
||||||
.await?;
|
.await?;
|
||||||
}
|
}
|
||||||
writer.flush().await?;
|
writer.flush().await?;
|
||||||
|
} else {
|
||||||
|
log::warn!(
|
||||||
|
"Requested chat history for user {user:?} even though the capability was not negotiated"
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cmd => {
|
cmd => {
|
||||||
|
|
Loading…
Reference in New Issue