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 @@ def build_message_stanza(self, message): ...@@ -343,6 +343,11 @@ def build_message_stanza(self, message):
stanza.setTag('no-store', stanza.setTag('no-store',
namespace=Namespace.MSG_HINTS) namespace=Namespace.MSG_HINTS)
# Add other nodes
if message.nodes is not None:
for node in message.nodes:
stanza.addChild(node=node)
return stanza return stanza
def log_message(self, message): def log_message(self, message):
......
...@@ -65,7 +65,8 @@ def __init__(self, ...@@ -65,7 +65,8 @@ def __init__(self,
correct_id=None, correct_id=None,
automatic_message=False, automatic_message=False,
oob_url=None, oob_url=None,
xhtml=None): xhtml=None,
nodes=None):
if type_ not in ('chat', 'groupchat', 'normal', 'headline'): if type_ not in ('chat', 'groupchat', 'normal', 'headline'):
raise ValueError('Unknown message type: %s' % type_) raise ValueError('Unknown message type: %s' % type_)
...@@ -110,6 +111,8 @@ def __init__(self, ...@@ -110,6 +111,8 @@ def __init__(self,
if xhtml is not None: if xhtml is not None:
self.additional_data.set_value('gajim', 'xhtml', xhtml) self.additional_data.set_value('gajim', 'xhtml', xhtml)
self.nodes = nodes
self.timestamp = None self.timestamp = None
self.message_id = None self.message_id = None
self.stanza = 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