Mercurial > xib
comparison 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 |
comparison
equal
deleted
inserted
replaced
8:1463f4620fca | 9:4b2faa511f01 |
---|---|
762 self.send_raw("PONG %s%s" % (target, target2 and (" " + target2))) | 762 self.send_raw("PONG %s%s" % (target, target2 and (" " + target2))) |
763 | 763 |
764 def privmsg(self, target, text): | 764 def privmsg(self, target, text): |
765 """Send a PRIVMSG command.""" | 765 """Send a PRIVMSG command.""" |
766 # Should limit len(text) here! | 766 # Should limit len(text) here! |
767 self.send_raw("PRIVMSG %s :%s" % (target, text)) | 767 for l in text.split('\n'): |
768 self.send_raw("PRIVMSG %s :%s" % (target, l)) | |
768 | 769 |
769 def privmsg_many(self, targets, text): | 770 def privmsg_many(self, targets, text): |
770 """Send a PRIVMSG command to multiple targets.""" | 771 """Send a PRIVMSG command to multiple targets.""" |
771 # Should limit len(text) here! | 772 # Should limit len(text) here! |
772 self.send_raw("PRIVMSG %s :%s" % (",".join(targets), text)) | 773 for l in text.split('\n'): |
774 self.send_raw("PRIVMSG %s :%s" % (",".join(targets), l)) | |
773 | 775 |
774 def quit(self, message=""): | 776 def quit(self, message=""): |
775 """Send a QUIT command.""" | 777 """Send a QUIT command.""" |
776 # Note that many IRC servers don't use your QUIT message | 778 # Note that many IRC servers don't use your QUIT message |
777 # unless you've been connected for at least 5 minutes! | 779 # unless you've been connected for at least 5 minutes! |