]> kaliko git repositories - sid.git/commitdiff
Allow space in front of prefix
authorkaliko <kaliko@azylum.org>
Sat, 15 Nov 2014 10:43:21 +0000 (11:43 +0100)
committerkaliko <kaliko@azylum.org>
Sat, 15 Nov 2014 10:43:21 +0000 (11:43 +0100)
traceback sent in debug mode only

sid/sid.py

index 7c3a5c7a6db9540b8fffb65dd3e4e240dbf759f1..726f7fa9888fac496725022596f23fb0463f31aa 100644 (file)
@@ -89,7 +89,7 @@ class MUCBot(sleekxmpp.ClientXMPP):
 
     def muc_message(self, msg):
         # ignore message from self
-        body = msg['body']
+        body = msg['body'].strip()
         mucfrom = msg['mucnic']
         if msg['mucnick'] == self.nick:
             return
@@ -107,6 +107,9 @@ class MUCBot(sleekxmpp.ClientXMPP):
         except Exception as err:
             reply = ''.join(traceback.format_exc())
             self.log.exception('An error occurred processing: {0}: {1}'.format(body, reply))
+            self.log.info(self.log.level)
+            if self.log.level >= 20 or not reply:
+                return
         self.send_message(mto=msg['from'].bare, mbody=reply, mtype='groupchat')
 
     def start(self, event):