nickserv/chanserv: announce a blocked look-alike registration to the staff feed (ServiceCtx alert drained by dispatch)
All checks were successful
CI / check (push) Successful in 3m44s
All checks were successful
CI / check (push) Successful in 3m44s
This commit is contained in:
parent
89ac01d0b0
commit
0d16240606
5 changed files with 46 additions and 0 deletions
|
|
@ -422,6 +422,10 @@ pub struct ServiceCtx {
|
|||
// folds these into the shared registry after the command runs — so every
|
||||
// service reports its own stats through one shared pipe.
|
||||
pub stats: Vec<String>,
|
||||
// Staff-feed alerts (category, text) about what the sender just did. The
|
||||
// engine drains these to the log channel, prefixing the sender's nick/host —
|
||||
// e.g. a blocked look-alike registration attempt.
|
||||
pub alerts: Vec<(String, String)>,
|
||||
}
|
||||
|
||||
impl ServiceCtx {
|
||||
|
|
@ -467,6 +471,12 @@ impl ServiceCtx {
|
|||
self.stats.push(key.into());
|
||||
}
|
||||
|
||||
// Send a line to the staff feed about what the sender just did. The engine
|
||||
// prefixes the sender's nick/host and routes it to the log channel.
|
||||
pub fn alert(&mut self, category: impl Into<String>, text: impl Into<String>) {
|
||||
self.alerts.push((category.into(), text.into()));
|
||||
}
|
||||
|
||||
// A channel/target message sourced from one of our pseudo-clients (e.g. a
|
||||
// bot answering a fantasy command, or BotServ SAY).
|
||||
pub fn privmsg(&mut self, from: &str, to: &str, text: impl Into<String>) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue