def availableReceived(self, entity, show=None, statuses=None, priority=0): log.msg("Available from %s (%s, %s, pri=%s)" % ( entity.full(), show, statuses, priority)) if priority >= 0 and show not in ['xa', 'dnd']: scheduling.available_user(entity) else: log.msg("Marking jid unavailable due to negative priority or " "being somewhat unavailable.") scheduling.unavailable_user(entity)
def onRosterSet(self, item): if not item.subscriptionTo and not item.subscriptionFrom and not item.ask: log.msg("Subscription of %s is none" % item.jid.userhost()) self.removeItem(item.jid) scheduling.unavailable_user(item.jid) try: u = models.User.update_status(item.jid.userhost(), 'unsubscribed') except: log.err()
def availableReceived(self, entity, show=None, statuses=None, priority=0): log.msg("Available from %s (%s, %s, pri=%s)" % (entity.full(), show, statuses, priority)) if priority >= 0 and show not in ['xa', 'dnd']: scheduling.available_user(entity) else: log.msg("Marking jid unavailable due to negative priority or " "being somewhat unavailable.") scheduling.unavailable_user(entity) self._find_and_set_status(entity.userhost(), show)
def availableReceived(self, entity, show=None, statuses=None, priority=0): log.msg("Available from %s (%s, %s, pri=%s)" % (entity.full(), show, statuses, priority)) if entity.userhost() == JID(config.SCREEN_NAME).userhost(): return if priority >= 0 and show not in ['xa', 'dnd']: scheduling.available_user(entity) else: log.msg("Marking jid unavailable due to negative priority or " "being somewhat unavailable.") scheduling.unavailable_user(entity)
def unavailableReceived(self, entity, statuses=None): log.msg("Unavailable from %s" % entity.full()) scheduling.unavailable_user(entity)
def onError(self, msg): log.msg("Error received for %s: %s" % (msg['from'], msg.toXml())) scheduling.unavailable_user(JID(msg['from']))
def cb(): scheduling.unavailable_user(entity)