Properly \n-terminate each send.
authorEric S. Raymond <esr@thyrsus.com>
Sun, 7 Oct 2012 07:26:47 +0000 (03:26 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 7 Oct 2012 07:26:47 +0000 (03:26 -0400)
This simple change is slightly wrong in a way that IRC servers hide -
strictly speaking we should not append a '\n' to the very last
segment.

irkerd

diff --git a/irkerd b/irkerd
index 321bb5ff1a710a2065c01b09036a2cf7f0a8b527..9b7e8d2957be24663859b5f0d73df33b6dea0e79 100755 (executable)
--- a/irkerd
+++ b/irkerd
@@ -250,7 +250,7 @@ class Connection:
                         self.connection.join(channel)
                         self.irker.debug(1, "joining %s on %s." % (channel, self.servername))
                     for segment in message.split("\n"):
-                        self.connection.privmsg(channel, segment)
+                        self.connection.privmsg(channel, segment + "\n")
                         time.sleep(ANTI_FLOOD_DELAY)
                     self.last_xmit = self.channels_joined[channel] = time.time()
                     self.irker.debug(1, "XMIT_TTL bump (%s transmission) at %s" % (self.servername, time.asctime()))