]> jfr.im git - erebus.git/blobdiff - modules/basic_socket.py
move responsibility for input logging to the core
[erebus.git] / modules / basic_socket.py
index f81822bed795a011e7b147c03ef373b867a5581a..1f6563d5c293f6c4653402d1ebd483dc542b87d9 100644 (file)
@@ -64,10 +64,8 @@ class BasicServer(object):
                return lines
 
        def parse(self, line):
-               peer = self.sock.getpeername()
                bot = lib.parent.randbot()
                maxlen = bot.maxmsglen() - len("PRIVMSG  :") - len(self.chan)
-               lib.parent.log(str(self), 'I', line)
                while len(line) > maxlen:
                        cutat = line.rfind(' ', 0, maxlen)
                        if cutat == -1:
@@ -77,6 +75,8 @@ class BasicServer(object):
                bot.msg(self.chan, line)
 
        def send(self, line):
+               if lib.parent.parent.cfg.getboolean('debug', 'io'):
+                       lib.parent.log(str(self), 'O', line)
                self.sock.sendall(line.encode('utf-8', 'backslashreplace')+b"\r\n")
 
        def _getsockerr(self):