Truncate sent messages to 450 characters

This commit is contained in:
Némunaire 2012-06-30 16:38:07 +02:00
parent 3a7ffb03be
commit adc65ab84e

View File

@ -82,7 +82,10 @@ class Server(threading.Thread):
if msg is not None and channel is not None:
for line in msg.split("\n"):
if line != "":
self.s.send (("%s %s :%s%s" % (cmd, channel, line, endl)).encode ())
if len(line) < 442:
self.s.send (("%s %s :%s%s" % (cmd, channel, line, endl)).encode ())
else:
self.s.send (("%s %s :%s%s" % (cmd, channel, line[0:442]+"...", endl)).encode ())
def send_msg_prtn (self, msg):
self.send_msg_final(self.partner, msg)