XEP-0380: Add a helper to test for the presence of an EME tag.

This commit is contained in:
Emmanuel Gil Peyrot 2016-11-26 16:41:48 +00:00
parent 4847f834bd
commit 457785b286

View file

@ -55,6 +55,9 @@ class XEP_0380(BasePlugin):
def session_bind(self, jid):
self.xmpp.plugin['xep_0030'].add_feature(Encryption.namespace)
def has_eme(self, msg):
return msg.xml.find('{%s}encryption' % Encryption.namespace) is not None
def replace_body_with_eme(self, msg):
eme = msg['eme']
namespace = eme['namespace']