aboutsummaryrefslogtreecommitdiff
path: root/src/hooks/sed.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/hooks/sed.rs')
-rw-r--r--src/hooks/sed.rs18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/hooks/sed.rs b/src/hooks/sed.rs
index d46a9bf..1ee0b20 100644
--- a/src/hooks/sed.rs
+++ b/src/hooks/sed.rs
@@ -24,7 +24,11 @@ impl Sed {
}
fn log_msg(&mut self, msg: Message) -> Result<()> {
- if let Command::PRIVMSG(target, text) = msg.command.clone() {
+ if let Command::PRIVMSG(target, mut text) = msg.command.clone() {
+ if text.starts_with("\x01ACTION") {
+ text = text.replace("\x01ACTION", "\x01\x01");
+ }
+
match self.0.get_mut(&target) {
Some(log) => {
if log.len() >= LOG_MAX_SIZE {
@@ -72,7 +76,17 @@ impl Sed {
.iter()
.rev()
.find(|(_, text)| cmd.expr.is_match(text) && !RE.with(|re| re.is_match(text)))
- .and_then(|(nick, text)| Some(format!("<{}> {}", nick, cmd.execute(text))))
+ .and_then(|(nick, text)| {
+ if text.starts_with("\x01\x01") {
+ Some(format!(
+ "* {}{}",
+ nick,
+ cmd.execute(text.replace("\x01", ""))
+ ))
+ } else {
+ Some(format!("<{}> {}", nick, cmd.execute(text)))
+ }
+ })
.map_or(Err(anyhow!("replace failed")), |v| Ok(v));
}
duction/main.jsonnet?h=1.3.1&id=ffab48bb8e1326eeb5d96f617d267058d0e19bfe&follow=1'>remove egress gateway configMax Audron-10/+0 2021-06-05update tanka dependenciesMax Audron-8/+8 2021-06-05fix init container nameMax Audron-1/+1 2021-06-05fix tanka dependency pathMax Audron-8/+8 2021-06-05switch to https url for tanka util libMax Audron-2/+2 2021-06-05bump version to 1.0.2Max Audron-2/+2 2021-06-05add tanka ci configurationMax Audron-1/+1 2021-06-05ready tanka deploy for CIMax Audron-32/+69 2021-06-05remove tanka vendoringMax Audron-27651/+0 2021-05-26Release 1.0.1Max Audron-3/+3 2021-05-26fix log breaking once buffer fullMax Audron-2/+33 2021-05-16add deployment stuffMax Audron-6/+27786 2021-05-15add container buildMax Audron-2/+35