Hi,
I’m using Smack 4.4.5 and I’ve run into something I’d like to double-check.
My code:
val queryArgs = MamQueryArgs.builder()
.setResultPageSize(30)
.queryLastPage()
.afterUid(archiveId)
.build()
What I observe:
-
If there are messages after
archiveId, I get the last page of those messages, as expected. -
If there are no messages after
archiveId, the query returns the last page of the archive, i.e. messages precedingarchiveId.
I was expecting an empty result in that case (no messages after the anchor), but queryLastPage() seems to override that and always return the last available page.
Questions:
-
Is this the intended behaviour according to MAM / Smack?
-
Is there a way to ask for “last page only if there are results after
afterUid, otherwise return nothing”?
Or shouldqueryLastPage()simply not be combined with an anchor?
Thanks!