home · contact · privacy
Fix crash on "!" message.
[plomlombot-irc.git] / plomlombot.py
index 0012baffd9a94ced7e54a09073fa606466bc8064..ac78be9fa88d967fd5e71b6cbd37bfa710c17787 100755 (executable)
@@ -74,8 +74,8 @@ class Log:
         identity = ""
         separator = " > "
         if sent:
-            separator = " "
-            line = Line(line)
+            separator = " "
+            line = Line("< " + line)
             line.sender = self.nickname
             identity = self.username + "@localhost"
         else:
@@ -488,7 +488,7 @@ class Session:
                         notice("maximum number of urls to parse per message "
                                "reached")
                         break
-            if "!" == msg[0]:
+            if "!" == msg[0] and len(tokens) > 1:
                 tokens = msg[1:].split()
                 argument = str.join(" ", tokens[1:])
                 handle_command(tokens[0], argument, notice, target, self)