Commit 3ffa37f2 authored by Philipp Hörist's avatar Philipp Hörist

Refactor parsing xhtml

Adapt to nbxmpp changes
parent 9225b79d
......@@ -174,6 +174,7 @@ class Message(BaseModule):
'muc_pm': properties.is_muc_pm,
'gc_control': gc_control,
'attention': properties.attention,
'xhtml': parse_xhtml(properties),
}
app.nec.push_incoming_event(NetworkEvent('update-client-info',
......@@ -210,7 +211,6 @@ class Message(BaseModule):
'subject': subject,
'displaymarking': parse_securitylabel(event.stanza),
'user_nick': '' if event.sent else parse_nickname(event.stanza),
'xhtml': parse_xhtml(event.stanza),
}
for name, value in event_attr.items():
......
......@@ -43,7 +43,7 @@ def parse_correction(properties):
# XEP-0071: XHTML-IM
def parse_xhtml(stanza):
def parse_xhtml(properties):
if app.config.get('ignore_incoming_xhtml'):
return None
return stanza.getXHTML()
return properties.xhtml
......@@ -120,6 +120,7 @@ class ConnectionHandlersZeroconf(connection_handlers.ConnectionHandlersBase):
'muc_pm': False,
'gc_control': None,
'attention': properties.attention,
'xhtml': parse_xhtml(properties),
}
event = ZeroconfMessageReceivedEvent(None, **event_attr)
......@@ -144,7 +145,6 @@ class ConnectionHandlersZeroconf(connection_handlers.ConnectionHandlersBase):
'subject': None,
'displaymarking': None,
'user_nick': parse_nickname(event.stanza),
'xhtml': parse_xhtml(event.stanza),
'stanza_id': event.unique_id
}
......
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