__description__ = 'An xmpp bot based on slixmpp'
# Use semantic versioning as much as possible
# https://www.python.org/dev/peps/pep-0440/
-__version__ = '0.3.0'
+__version__ = '0.4.0'
__url__ = 'http://git.kaliko.me/?p=sid.git'
__doc__ = 'https://kaliko.gitlab.io/sid/'
self.tempo = plugin.TEMPO
self.plugin = plugin
self.last_check = datetime.datetime.utcnow()
- self.seen = dict()
+ self.seen = {}
self.thread_killed = False
def _update_cache(self, feed, parsed):
- self.seen[feed].update({'ids': {p.id for p in parsed.entries} or {}})
+ self.seen[feed].update({'ids': {p.id for p in parsed.entries} or set()})
# Common HTTP caching
if parsed.get('etag', False):
self.seen[feed].update({'cache': {'etag': parsed.etag}})
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):
- 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):
- 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)