commit 9b21dcac56f09abc8df88b2c4fba8b72d717346b
parent f36d913770bc855bece0ddfb8ebf1be4ea49a6d2
Author: Antoine Amarilli <a3nm@a3nm.net>
Date: Sat, 21 Dec 2013 02:09:54 +0100
fix pruning for private messages
Diffstat:
2 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/irctk.c b/irctk.c
@@ -1606,6 +1606,10 @@ void event_channel (irc_session_t *session, const char *event,
}
pruned++;
}
+ if (params[0][0] != '#') {
+ // must be a private message
+ ok2 = 0;
+ }
if (ok2) {
pruned++; // skip ':'
diff --git a/test/msg.sh b/test/msg.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+trap 'kill $(jobs -p)' EXIT
+
+mkdir -p msg
+cd msg
+
+seq 3 | awk '{print $0, $0}' > ref
+tail -f /dev/null | ../../irctk -Ff msgi@localhost > heard &
+PID=$!
+sleep 1
+cat ref | ../../irctk msgo@localhost msgi
+sleep 1
+kill $PID
+diff ref heard