diff --git a/lang/es.conf b/lang/es.conf index 8abd2b7..8fc6a0d 100644 --- a/lang/es.conf +++ b/lang/es.conf @@ -88,6 +88,16 @@ "XLINE: {0} removed a {1}" = "XLINE: {0} eliminó un {1}" "XLINE: {0}-line on {1} expired" = "XLINE: la {0}-line sobre {1} ha expirado" +# --- cierre de enlace (ERROR del lado del cliente al desconectar) --- +"Closing link: ({0})" = "Cerrando enlace: ({0})" +"Closing link: (R-lined: {0})" = "Cerrando enlace: (R-lined: {0})" +"Closing link: (SAQUIT: {0})" = "Cerrando enlace: (SAQUIT: {0})" +"Closing link (registration refused)" = "Cerrando enlace (registro rechazado)" +"Closing link: (Too many connections from your IP)" = "Cerrando enlace: (Demasiadas conexiones desde tu IP)" +"Closing link: (Excess flood)" = "Cerrando enlace: (Exceso de flood)" +"Closing link (dropped)" = "Cerrando enlace (descartado)" +"Closing link (incorrect ping reply)" = "Cerrando enlace (respuesta de ping incorrecta)" + # --- avisos / desafíos --- "*** Cloudflare Challenge: verification successful — you may continue." = "*** Desafío de Cloudflare: verificación exitosa — puedes continuar." "*** Correct — you may now message freely; please resend your message." = "*** Correcto — ya puedes enviar mensajes libremente; por favor reenvía tu mensaje." diff --git a/lang/fr.conf b/lang/fr.conf index a37ba79..1ba039b 100644 --- a/lang/fr.conf +++ b/lang/fr.conf @@ -88,6 +88,16 @@ "XLINE: {0} removed a {1}" = "XLINE : {0} a supprimé un {1}" "XLINE: {0}-line on {1} expired" = "XLINE : la {0}-line sur {1} a expiré" +# --- fermeture de lien (ERROR côté client au moment de la déconnexion) --- +"Closing link: ({0})" = "Fermeture du lien : ({0})" +"Closing link: (R-lined: {0})" = "Fermeture du lien : (R-lined : {0})" +"Closing link: (SAQUIT: {0})" = "Fermeture du lien : (SAQUIT : {0})" +"Closing link (registration refused)" = "Fermeture du lien (enregistrement refusé)" +"Closing link: (Too many connections from your IP)" = "Fermeture du lien : (Trop de connexions depuis votre IP)" +"Closing link: (Excess flood)" = "Fermeture du lien : (Excès de flood)" +"Closing link (dropped)" = "Fermeture du lien (abandonné)" +"Closing link (incorrect ping reply)" = "Fermeture du lien (réponse au ping incorrecte)" + # --- notices / défis --- "*** Cloudflare Challenge: verification successful — you may continue." = "*** Défi Cloudflare : vérification réussie — vous pouvez continuer." "*** Correct — you may now message freely; please resend your message." = "*** Correct — vous pouvez maintenant envoyer des messages librement ; veuillez renvoyer votre message." diff --git a/src/coremods/core_oper.rs b/src/coremods/core_oper.rs index b430be5..2adba18 100644 --- a/src/coremods/core_oper.rs +++ b/src/coremods/core_oper.rs @@ -1349,7 +1349,8 @@ impl Command for SaQuit { .cloned() .unwrap_or_else(|| "Services forced quit".to_string()); if s.uid_servprotected(tuid) { s.numeric(uid, ERR_NOPRIVILEGES, ":Cannot use an SA command on a network service"); return CmdResult::Fail; } - s.send(tuid, format!("ERROR :Closing link: (SAQUIT: {reason})")); + let m = s.trf("Closing link: (SAQUIT: {0})", &[reason.as_str()]); + s.send(tuid, format!("ERROR :{m}")); s.remove_user(tuid, &format!("Quit: {reason}")); let by = oper_nick(s, uid); let m = s.trf("{0} used SAQUIT on {1}: {2}", &[by.as_str(), params[0].as_str(), reason.as_str()]); diff --git a/src/coremods/core_user.rs b/src/coremods/core_user.rs index 55375f2..7c994f1 100644 --- a/src/coremods/core_user.rs +++ b/src/coremods/core_user.rs @@ -572,7 +572,8 @@ impl Command for Nick { }); if let Some((nk, id, ho, ip, rn)) = info { if let Some(reason) = s.matched_rline(&nk, &id, &ho, &ip, &rn) { - s.send(uid, format!("ERROR :Closing link: ({reason})")); + let m = s.trf("Closing link: ({0})", &[reason.as_str()]); + s.send(uid, format!("ERROR :{m}")); s.remove_user(uid, &reason); } } diff --git a/src/ircd.rs b/src/ircd.rs index 2815428..227f684 100644 --- a/src/ircd.rs +++ b/src/ircd.rs @@ -569,10 +569,8 @@ impl Ircd { for m in &mut self.modules { match m.on_user_register(&mut self.server, uid) { ModResult::Deny => { - self.server.send( - uid, - "ERROR :Closing link (registration refused)".to_string(), - ); + let m = self.server.trf("Closing link (registration refused)", &[]); + self.server.send(uid, format!("ERROR :{m}")); self.server.remove_user(uid, "Registration refused"); return; } @@ -588,15 +586,15 @@ impl Ircd { (u.ident.clone(), u.host.clone(), u.addr.ip().to_string()) }; if let Some(reason) = self.server.matched_xline(&ident, &host, &ip) { - self.server - .send(uid, format!("ERROR :Closing link: ({reason})")); + let m = self.server.trf("Closing link: ({0})", &[reason.as_str()]); + self.server.send(uid, format!("ERROR :{m}")); self.server.remove_user(uid, &reason); return; } // ident: apply a confirmed username (dropping `~`) and enforce requireident if let Some(reason) = crate::modules::ident::finalize(&mut self.server, uid) { - self.server - .send(uid, format!("ERROR :Closing link: ({reason})")); + let m = self.server.trf("Closing link: ({0})", &[reason.as_str()]); + self.server.send(uid, format!("ERROR :{m}")); self.server.remove_user(uid, &reason); return; } @@ -613,8 +611,8 @@ impl Ircd { ) }; if let Some(reason) = rl { - self.server - .send(uid, format!("ERROR :Closing link: ({reason})")); + let m = self.server.trf("Closing link: ({0})", &[reason.as_str()]); + self.server.send(uid, format!("ERROR :{m}")); self.server.remove_user(uid, &reason); return; } @@ -636,8 +634,8 @@ impl Ircd { fn reject_link(&mut self, uid: Uid, reason: &str) { self.server .numeric(uid, ERR_PASSWDMISMATCH, &format!(":{reason}")); - self.server - .send(uid, format!("ERROR :Closing link: ({reason})")); + let m = self.server.trf("Closing link: ({0})", &[reason]); + self.server.send(uid, format!("ERROR :{m}")); self.server.remove_user(uid, reason); } @@ -705,8 +703,8 @@ impl Ircd { } else { "Registration timeout" }; - self.server - .send(uid, format!("ERROR :Closing link: ({reason})")); + let m = self.server.trf("Closing link: ({0})", &[reason]); + self.server.send(uid, format!("ERROR :{m}")); self.quit_user(uid, reason); } // republish gauges (the core owns this state; the scrape thread only reads) diff --git a/src/modules/autodrop.rs b/src/modules/autodrop.rs index b280f5a..85b6ad5 100644 --- a/src/modules/autodrop.rs +++ b/src/modules/autodrop.rs @@ -55,7 +55,8 @@ impl Module for AutoDrop { .get::() .is_some_and(|c| c.cmds.contains(&cmd.to_ascii_uppercase())); if hit { - s.send(uid, "ERROR :Closing link (dropped)".to_string()); + let m = s.trf("Closing link (dropped)", &[]); + s.send(uid, format!("ERROR :{m}")); s.remove_user(uid, "Autodropped"); return ModResult::Deny; } diff --git a/src/modules/conn_waitpong.rs b/src/modules/conn_waitpong.rs index 66c1499..bd62ef8 100644 --- a/src/modules/conn_waitpong.rs +++ b/src/modules/conn_waitpong.rs @@ -68,10 +68,8 @@ pub fn on_pong(s: &mut Server, uid: Uid, params: &[String]) { u.waitpong = None; } } else if s.conf_bool("conn_waitpong_killonbadreply", false) { - s.send( - uid, - "ERROR :Closing link (incorrect ping reply)".to_string(), - ); + let m = s.trf("Closing link (incorrect ping reply)", &[]); + s.send(uid, format!("ERROR :{m}")); s.remove_user(uid, "Incorrect ping reply"); } } diff --git a/src/modules/dnsbl.rs b/src/modules/dnsbl.rs index e9a9feb..6d03219 100644 --- a/src/modules/dnsbl.rs +++ b/src/modules/dnsbl.rs @@ -210,7 +210,8 @@ fn act(s: &mut Server, uid: Uid, domain: &str) { if closes { // pre-registration users aren't caught by add_xline's enforce sweep, so close // this connection explicitly (the ERROR flushes before the socket). - s.send(uid, format!("ERROR :Closing link: ({reason})")); + let m = s.trf("Closing link: ({0})", &[reason.as_str()]); + s.send(uid, format!("ERROR :{m}")); s.remove_user(uid, &reason); } } diff --git a/src/modules/filter.rs b/src/modules/filter.rs index f1e05a9..e349268 100644 --- a/src/modules/filter.rs +++ b/src/modules/filter.rs @@ -71,7 +71,8 @@ impl Module for Filter { "block" => s.notice_star(uid, &format!("Your message was blocked: {reason}")), "silent" => {} "kill" => { - s.send(uid, format!("ERROR :Closing link: ({reason})")); + let m = s.trf("Closing link: ({0})", &[reason.as_str()]); + s.send(uid, format!("ERROR :{m}")); s.remove_user(uid, &reason); } "kline" => { diff --git a/src/modules/flood.rs b/src/modules/flood.rs index 0a0e4e3..578ea63 100644 --- a/src/modules/flood.rs +++ b/src/modules/flood.rs @@ -58,7 +58,8 @@ impl Module for Flood { if over { if !fakelag { // fakelag disabled: disconnect the flooder instead of throttling - srv.send(uid, "ERROR :Closing link: (Excess flood)".to_string()); + let m = srv.trf("Closing link: (Excess flood)", &[]); + srv.send(uid, format!("ERROR :{m}")); srv.mark_quit(uid, "Excess flood".to_string()); return ModResult::Deny; } diff --git a/src/server.rs b/src/server.rs index 239926d..99edeac 100644 --- a/src/server.rs +++ b/src/server.rs @@ -481,10 +481,8 @@ impl Server { // connflood — refuse an IP that's opening connections too fast (see modules::connflood) if crate::modules::connflood::over_limit(self, ip) { - self.send( - uid, - "ERROR :Closing link: (Too many connections from your IP)".to_string(), - ); + let m = self.trf("Closing link: (Too many connections from your IP)", &[]); + self.send(uid, format!("ERROR :{m}")); self.remove_user(uid, "Connection throttled"); return; } @@ -494,7 +492,8 @@ impl Server { // connectclass — assign a connection class; a deny class or per-IP cap rejects if let Some(reason) = crate::modules::connclass::assign(self, uid) { - self.send(uid, format!("ERROR :Closing link: ({reason})")); + let m = self.trf("Closing link: ({0})", &[reason.as_str()]); + self.send(uid, format!("ERROR :{m}")); self.remove_user(uid, &reason); return; } diff --git a/src/xline.rs b/src/xline.rs index e1fa768..6f19b0f 100644 --- a/src/xline.rs +++ b/src/xline.rs @@ -270,7 +270,8 @@ impl Server { .map(|(&uid, _)| uid) .collect(); for uid in victims { - self.send(uid, format!("ERROR :Closing link: (R-lined: {reason})")); + let m = self.trf("Closing link: (R-lined: {0})", &[reason]); + self.send(uid, format!("ERROR :{m}")); self.remove_user(uid, &format!("R-lined: {reason}")); } } @@ -365,7 +366,8 @@ impl Server { }) .collect(); for (uid, reason) in victims { - self.send(uid, format!("ERROR :Closing link: ({reason})")); + let m = self.trf("Closing link: ({0})", &[reason.as_str()]); + self.send(uid, format!("ERROR :{m}")); self.remove_user(uid, &reason); } }