Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/python-nbxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlovetox <philipp@hoerist.com>2020-04-11 17:08:56 +0300
committerlovetox <philipp@hoerist.com>2020-04-11 17:08:56 +0300
commit852b29d8be3816ea8dbf8c54e84dd184d5f10066 (patch)
treeda958628716bd7a6bd779f665f2e368400b16acb
parentd8b35aca9095e7a3d6b43c0991e982baf9530259 (diff)
MAM: Check for first and last element in IQ result
-rw-r--r--nbxmpp/modules/mam.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/nbxmpp/modules/mam.py b/nbxmpp/modules/mam.py
index 0dd7528..b65c82c 100644
--- a/nbxmpp/modules/mam.py
+++ b/nbxmpp/modules/mam.py
@@ -119,6 +119,12 @@ class MAM(BaseModule):
'rsm set missing')
complete = fin.getAttr('complete') == 'true'
+ if not complete:
+ if rsm.first is None or rsm.last is None:
+ return raise_error(self._log.warning,
+ stanza,
+ 'stanza-malformed',
+ 'missing first or last element')
return MAMQueryData(jid=jid,
complete=complete,