Mercurial > xib
diff irclib.py @ 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 | cb0daec4b778 |
children | 1a1f2a0d35c7 |
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."""