Commit f532ff35 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Correctly handle RSM count request

Fixes #120
parent 589fd699
Pipeline #8031 passed with stages
in 5 minutes and 12 seconds
......@@ -66,7 +66,10 @@ class MAM(BaseModule):
raise MalformedStanzaError('rsm set missing', response)
complete = fin.getAttr('complete') == 'true'
if not complete:
if max_ != 0 and not complete:
# max_ == 0 is a request for count of the items in a result set
# in this case first and last will be absent
# See: https://xmpp.org/extensions/xep-0059.html#count
if rsm.first is None or rsm.last is None:
raise MalformedStanzaError('first or last element missing',
response)
......
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