Commit ae397ca8 authored by Philipp Hörist's avatar Philipp Hörist

Message: Allow plugins to add arbitrary xml elements

parent 147ed3c5
......@@ -343,6 +343,11 @@ class Message(BaseModule):
stanza.setTag('no-store',
namespace=Namespace.MSG_HINTS)
# Add other nodes
if message.nodes is not None:
for node in message.nodes:
stanza.addChild(node=node)
return stanza
def log_message(self, message):
......
......@@ -65,7 +65,8 @@ class OutgoingMessage:
correct_id=None,
automatic_message=False,
oob_url=None,
xhtml=None):
xhtml=None,
nodes=None):
if type_ not in ('chat', 'groupchat', 'normal', 'headline'):
raise ValueError('Unknown message type: %s' % type_)
......@@ -110,6 +111,8 @@ class OutgoingMessage:
if xhtml is not None:
self.additional_data.set_value('gajim', 'xhtml', xhtml)
self.nodes = nodes
self.timestamp = None
self.message_id = None
self.stanza = None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment