changeset 9:4b2faa511f01

Fixed multi-line message bug Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Sun, 16 Aug 2009 22:18:42 +0200
parents 1463f4620fca
children 7cb790f5f243
files irclib.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/irclib.py
+++ b/irclib.py
@@ -764,12 +764,14 @@ class ServerConnection(Connection):
     def privmsg(self, target, text):
         """Send a PRIVMSG command."""
         # Should limit len(text) here!
-        self.send_raw("PRIVMSG %s :%s" % (target, text))
+        for l in text.split('\n'):
+            self.send_raw("PRIVMSG %s :%s" % (target, l))
 
     def privmsg_many(self, targets, text):
         """Send a PRIVMSG command to multiple targets."""
         # Should limit len(text) here!
-        self.send_raw("PRIVMSG %s :%s" % (",".join(targets), text))
+        for l in text.split('\n'):
+            self.send_raw("PRIVMSG %s :%s" % (",".join(targets), l))
 
     def quit(self, message=""):
         """Send a QUIT command."""