]> kaliko git repositories - sid.git/blobdiff - sid/sid.py
Do not answer messages from unseen
[sid.git] / sid / sid.py
index d412ac4ad65d362b0427cdafb35a2f6485e8e7bd..a62c7e46fd14fd7c0d61875cad45f8b650da802b 100644 (file)
@@ -123,9 +123,11 @@ class MUCBot(slixmpp.ClientXMPP):
         body = msg['body'].strip()
         if not body.startswith(MUCBot.prefix):
             return
-        if msg['from'] not in self.__seen:
-            self.log.warning('Will not handle message from unseen jid: %s', msg['from'])
-            #return
+        self.log.debug(msg['from'])
+        if msg['from'] not in self.__seen and msg['type'] == 'chat':
+            self.log.warning('Will not handle direct message'
+                             'from unseen jid: %s', msg['from'])
+            return
         args = body[1:].split()
         cmd = args.pop(0)
         if cmd not in self.commands: