Mercurial > libervia-backend
comparison sat/plugins/plugin_xep_0380.py @ 2759:607cfc79e40f
plugin XEP-0380: register namespace
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 06 Jan 2019 17:34:56 +0100 |
parents | 3bea6b5ae972 |
children | ab2696e34d29 |
comparison
equal
deleted
inserted
replaced
2758:f4070693814a | 2759:607cfc79e40f |
---|---|
47 | 47 |
48 def __init__(self, host): | 48 def __init__(self, host): |
49 self.host = host | 49 self.host = host |
50 host.trigger.add("sendMessage", self._sendMessageTrigger) | 50 host.trigger.add("sendMessage", self._sendMessageTrigger) |
51 host.trigger.add("MessageReceived", self._MessageReceivedTrigger, priority=100) | 51 host.trigger.add("MessageReceived", self._MessageReceivedTrigger, priority=100) |
52 host.registerNamespace(u"eme", NS_EME) | |
52 | 53 |
53 def _addEMEElement(self, mess_data, namespace, name): | 54 def _addEMEElement(self, mess_data, namespace, name): |
54 message_elt = mess_data[u'xml'] | 55 message_elt = mess_data[u'xml'] |
55 encryption_elt = message_elt.addElement((NS_EME, u'encryption')) | 56 encryption_elt = message_elt.addElement((NS_EME, u'encryption')) |
56 encryption_elt[u'namespace'] = namespace | 57 encryption_elt[u'namespace'] = namespace |