Mercurial > libervia-backend
diff src/plugins/plugin_sec_otr.py @ 1480:8d61160ee4b8
core, plugin watched: new plugin, show an alert when a watched entity goes online
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 20 Aug 2015 18:43:56 +0200 |
parents | 364dcdae2bff |
children | 62cd8fc1aef7 |
line wrap: on
line diff
--- a/src/plugins/plugin_sec_otr.py Thu Aug 20 18:41:06 2015 +0200 +++ b/src/plugins/plugin_sec_otr.py Thu Aug 20 18:43:56 2015 +0200 @@ -208,7 +208,7 @@ 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 @@ 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