Skip to content
Snippets Groups Projects
Commit 5ef18134 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Fix parsing MAM IQs

prosody includes the supplied queryid in the `<fin>` tag, but this is not XEP compliant.

We set the queryid attr so we can match the MAM Messages to our query.
Thats the only purpose, it is not used to identify the iq result at the end of the query.
For that purpose is the `id` attr on the `<iq>` node.

So dont try to parse `queryid` from the `<fin>` tag.
parent 67a008ea
No related branches found
No related tags found
No related merge requests found
......@@ -96,7 +96,7 @@ class ConnectionArchive313:
del self.mam_awaiting_disco_result[obj.jid]
@staticmethod
def parse_iq(stanza, query_id):
def parse_iq(stanza):
if not nbxmpp.isResultNode(stanza):
log.error('Error on MAM query: %s', stanza.getError())
raise InvalidMamIQ
......@@ -106,10 +106,6 @@ class ConnectionArchive313:
log.error('Malformed MAM query result received: %s', stanza)
raise InvalidMamIQ
if fin.getAttr('queryid') != query_id:
log.error('Result with unknown query id received')
raise InvalidMamIQ
set_ = fin.getTag('set', namespace=nbxmpp.NS_RSM)
if set_ is None:
log.error(
......@@ -129,7 +125,7 @@ class ConnectionArchive313:
def _result_finished(self, conn, stanza, query_id, start_date, groupchat):
try:
fin, set_ = self.parse_iq(stanza, query_id)
fin, set_ = self.parse_iq(stanza)
except InvalidMamIQ:
return
......@@ -158,7 +154,7 @@ class ConnectionArchive313:
def _intervall_result_finished(self, conn, stanza, query_id,
start_date, end_date, event_id):
try:
fin, set_ = self.parse_iq(stanza, query_id)
fin, set_ = self.parse_iq(stanza)
except InvalidMamIQ:
return
......@@ -190,7 +186,7 @@ class ConnectionArchive313:
def _received_count(self, conn, stanza, query_id, event_id):
try:
_, set_ = self.parse_iq(stanza, query_id)
_, set_ = self.parse_iq(stanza)
except InvalidMamIQ:
return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment