From 957947cf8d0fd74a6db319b8bd714cf0ecb71cf8 Mon Sep 17 00:00:00 2001 From: jesopo Date: Fri, 1 Apr 2016 10:46:00 +0100 Subject: [PATCH] added code to prevent newlines being where they shouldn't be in outgoing lines. --- IRCServer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRCServer.py b/IRCServer.py index c7f79050..054eb86c 100644 --- a/IRCServer.py +++ b/IRCServer.py @@ -154,7 +154,7 @@ class Server(object): self.last_read = time.time() return decoded_lines def send(self, data): - encoded = data.encode("utf8") + encoded = data.split("\n")[0].strip("\r").encode("utf8") if len(encoded) > 450: encoded = encoded[:450] self.write_buffer += b"%s\r\n" % encoded