chanserv: topic, invite, akick, list, status
Adds the remaining moderation and listing commands. Auto-kick masks are stored in the event log and enforced on join: a matching user is banned and kicked. Topic and invite are sourced from the ChanServ pseudoclient.
This commit is contained in:
parent
acd0e60946
commit
ba3803e01c
11 changed files with 369 additions and 7 deletions
|
|
@ -236,6 +236,16 @@ impl Protocol for InspIrcd {
|
|||
NetAction::Kick { from, channel, uid, reason } => {
|
||||
vec![format!(":{} KICK {} {} :{}", from, channel, uid, reason)]
|
||||
}
|
||||
// FTOPIC <chan> <chanTS> <topicTS> <setter> :<topic>. TS 1 so the ircd
|
||||
// always accepts it; sourced from the given pseudoclient.
|
||||
NetAction::Topic { from, channel, topic } => {
|
||||
let now = SystemTime::now().duration_since(UNIX_EPOCH).map(|d| d.as_secs()).unwrap_or(self.ts);
|
||||
vec![format!(":{} FTOPIC {} 1 {} {} :{}", from, channel, now, from, topic)]
|
||||
}
|
||||
// INVITE <uid> <chan> <chanTS> <expiry>. Expiry 0 = no expiry.
|
||||
NetAction::Invite { from, uid, channel } => {
|
||||
vec![format!(":{} INVITE {} {} 1 0", from, uid, channel)]
|
||||
}
|
||||
NetAction::Raw(s) => vec![s.clone()],
|
||||
// Internal: the link layer handles this before serialization.
|
||||
NetAction::DeferRegister { .. } => vec![],
|
||||
|
|
|
|||
|
|
@ -52,6 +52,10 @@ pub enum NetAction {
|
|||
ChannelMode { from: String, channel: String, modes: String },
|
||||
// Kick a user from a channel, sourced from pseudoclient `from`.
|
||||
Kick { from: String, channel: String, uid: String, reason: String },
|
||||
// Set a channel's topic, sourced from pseudoclient `from`.
|
||||
Topic { from: String, channel: String, topic: String },
|
||||
// Invite a user to a channel, sourced from pseudoclient `from`.
|
||||
Invite { from: String, uid: String, channel: String },
|
||||
Raw(String),
|
||||
// Internal only, never serialized to the wire: a registration whose password
|
||||
// still needs its (expensive) key derivation. The link layer runs the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue