Commits

lilydjwg  committed 0065093

new show presence: unavailable

  • Participants
  • Parent commits 2164927

Comments (0)

Files changed (2)

 
     st = self.get_xmpp_status(u)
     if st['show']:
-      line += ' (%s)' % xmpp_show_map[st['show']]
+      try:
+        line += ' (%s)' % xmpp_show_map[st['show']]
+      except KeyError:
+        line += _(' (unknown)')
+        logger.warn('unknown XMPP show: %s', st['show'])
     if st['status']:
       line += ' [%s]' % st['status'].strip()
     text.append(line)
 ONLINE  = _('online')
 CHAT    = _('chatty')
 OFFLINE = _('offline')
+UNAVAILABLE = _('unavailable')
 
 xmpp_show_map = {
   '':     ONLINE,
   'xa':   XAWAY,
   'chat': CHAT,
   'offline': OFFLINE,
+  'unavailable': UNAVAILABLE,
 }
 
 ONE_DAY = datetime.timedelta(hours=24)