core, plugin watched: new plugin, show an alert when a watched entity goes online
This commit is contained in:
parent
1fde823a9c
commit
135fba2de1
1 changed files with 89 additions and 8 deletions
|
|
@ -208,7 +208,7 @@ class OTR(object):
|
|||
host.importMenu((MAIN_MENU, D_("End session")), self._endSession, security_limit=0, help_string=D_("Finish an OTR session"), type_=C.MENU_SINGLE)
|
||||
host.importMenu((MAIN_MENU, D_("Authenticate")), self._authenticate, security_limit=0, help_string=D_("Authenticate user/see your fingerprint"), type_=C.MENU_SINGLE)
|
||||
host.importMenu((MAIN_MENU, D_("Drop private key")), self._dropPrivKey, security_limit=0, type_=C.MENU_SINGLE)
|
||||
host.trigger.add("presenceReceived", self.presenceReceivedTrigger)
|
||||
host.trigger.add("presenceReceived", self._presenceReceivedTrigger)
|
||||
|
||||
def _fixPotr(self):
|
||||
# FIXME: potr fix for bad unicode handling
|
||||
|
|
@ -472,8 +472,8 @@ class OTR(object):
|
|||
log.debug(u"sending message unencrypted")
|
||||
return True
|
||||
|
||||
def presenceReceivedTrigger(self, entity, show, priority, statuses, profile):
|
||||
if show != "unavailable":
|
||||
def _presenceReceivedTrigger(self, entity, show, priority, statuses, profile):
|
||||
if show != C.PRESENCE_UNAVAILABLE:
|
||||
return True
|
||||
if not entity.resource:
|
||||
entity.resource = self.host.memory.getMainResource(entity, profile) # FIXME: temporary and unsecure, must be changed when frontends are refactored
|
||||
|
|
|
|||
Loading…
Reference in a new issue