Mercurial > libervia-backend
comparison sat/plugins/plugin_sec_otr.py @ 2820:7ab8684784c6
core: renamed presenceReceived to presence_reveiced + use "client" as first arguments instead of "profile"
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 01 Mar 2019 12:12:50 +0100 |
parents | ba2e03ee7c4f |
children | 3d735e0ab2fa |
comparison
equal
deleted
inserted
replaced
2819:fd45089b3a92 | 2820:7ab8684784c6 |
---|---|
352 # (OTR_MENU, D_(u"Drop private key")), | 352 # (OTR_MENU, D_(u"Drop private key")), |
353 # self._dropPrivKey, | 353 # self._dropPrivKey, |
354 # security_limit=0, | 354 # security_limit=0, |
355 # type_=C.MENU_SINGLE, | 355 # type_=C.MENU_SINGLE, |
356 # ) | 356 # ) |
357 host.trigger.add("presenceReceived", self._presenceReceivedTrigger) | 357 host.trigger.add("presence_received", self._presenceReceivedTrigger) |
358 self.host.registerEncryptionPlugin(self, u"OTR", NS_OTR, directed=True) | 358 self.host.registerEncryptionPlugin(self, u"OTR", NS_OTR, directed=True) |
359 | 359 |
360 def _skipOTR(self, profile): | 360 def _skipOTR(self, profile): |
361 """Tell the backend to not handle OTR for this profile. | 361 """Tell the backend to not handle OTR for this profile. |
362 | 362 |
808 if not mess_data["to"].resource: | 808 if not mess_data["to"].resource: |
809 # if not resource was given, we force it here | 809 # if not resource was given, we force it here |
810 mess_data["to"] = to_jid | 810 mess_data["to"] = to_jid |
811 return True | 811 return True |
812 | 812 |
813 def _presenceReceivedTrigger(self, entity, show, priority, statuses, profile): | 813 def _presenceReceivedTrigger(self, client, entity, show, priority, statuses): |
814 if show != C.PRESENCE_UNAVAILABLE: | 814 if show != C.PRESENCE_UNAVAILABLE: |
815 return True | 815 return True |
816 client = self.host.getClient(profile) | |
817 if not entity.resource: | 816 if not entity.resource: |
818 try: | 817 try: |
819 entity.resource = self.host.memory.getMainResource( | 818 entity.resource = self.host.memory.getMainResource( |
820 client, entity | 819 client, entity |
821 ) # FIXME: temporary and unsecure, must be changed when frontends | 820 ) # FIXME: temporary and unsecure, must be changed when frontends |