Commit 13acb5af authored by Philipp Hörist's avatar Philipp Hörist

MAM: Simplify _parse_chat_attrs()

This became more simple due to nbxmpp changes
parent 8409f5e7
......@@ -174,7 +174,7 @@ class MAM(BaseModule):
if groupchat:
event_attrs.update(self._parse_chat_attrs(stanza, properties))
stanza_id, message_id = self._get_unique_id(properties)
......@@ -243,17 +243,13 @@ class MAM(BaseModule):
'real_jid': real_jid,
'kind': KindConstant.GC_MSG}
def _parse_chat_attrs(self, stanza, properties):
frm = properties.jid
to = stanza.getTo()
if frm.bareMatch(self._con.get_own_jid()):
with_ = to
def _parse_chat_attrs(self, properties):
if properties.from_.bareMatch(self._con.get_own_jid()):
kind = KindConstant.CHAT_MSG_SENT
with_ = frm
kind = KindConstant.CHAT_MSG_RECV
return {'with_': with_,
return {'with_': properties.jid,
'nick': None,
'kind': kind}
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