]> kaliko git repositories - sid.git/commitdiff
log: Add jid and nick dev
authorkaliko <kaliko@azylum.org>
Sat, 26 Oct 2024 16:32:24 +0000 (18:32 +0200)
committerkaliko <kaliko@azylum.org>
Sat, 26 Oct 2024 16:32:24 +0000 (18:32 +0200)
sid/log.py

index 1872c1beedf486c074f0f563b7e62b57726be54c..7962415b4f040b1ed9968e83c3477fa5640fd917 100644 (file)
@@ -34,18 +34,18 @@ class Log(Plugin):
         if not jid:
             self.log.debug('jid not found, is bot account moderating room?')
             return nick
         if not jid:
             self.log.debug('jid not found, is bot account moderating room?')
             return nick
-        jid = jid.split('/')[0]  # strip ressource
+        #jid = jid.split('/')[0]  # strip ressource
         return jid
 
     def log_online(self, pres):
         return jid
 
     def log_online(self, pres):
-        nick = self._get_jid(pres)
-        self.log.info('got online: %s', nick)
-        self.presence.append((datetime.now(), 'online', nick))
+        jid = self._get_jid(pres)
+        self.log.info('got online: %s as %s', jid, pres['muc']['nick'])
+        self.presence.append((datetime.now(), 'online', jid))
 
     def log_offline(self, pres):
 
     def log_offline(self, pres):
-        nick = self._get_jid(pres)
-        self.log.info('got offline: %s', nick)
-        self.presence.append((datetime.now(), 'offline', nick))
+        jid = self._get_jid(pres)
+        self.log.info('got offline: %s was %s', jid, pres['muc']['nick'])
+        self.presence.append((datetime.now(), 'offline', jid))
 
     def log_presence(self, pres):
         nick = self._get_jid(pres)
 
     def log_presence(self, pres):
         nick = self._get_jid(pres)