问题描述
我正在使用XMPPFramework for iOS通过XEP-0313消息存档管理实现检索XMPP聊天记录。我使用XMPPFramework的XMPPMessageArchiveManagement类逐页接收消息。我能够以相反的顺序接收页面,并提供下一页之前的消息。
let resultSet = XMPPResultSet(max: 50,before: theIdOfTheOldestReceivedMessage ?? "")
self.xmppMAM?.retrieveMessageArchive(at: to,withFields: [field],with: resultSet)
但是我也想从最后一页到第一页以相反的顺序在每个页面上接收消息。根据文档,我应该在查询中提供该元素:
<iq type='set' id='q29309'>
<query xmlns='urn:xmpp:mam:2'>
<x xmlns='jabber:x:data' type='submit'>
<field var='FORM_TYPE' type='hidden'><value>urn:xmpp:mam:2</value></field>
<field var='start'>\<value>2010-08-07T00:00:00Z\</value>\</field>
</x>
<set xmlns='http://jabber.org/protocol/rsm'>
<max>10</max>
<after>09af3-cc343-b409f\</after>
</set>
<flip-page/>
</query>
</iq>
来源:https://xmpp.org/extensions/xep-0313.html#query-paging-flip。
问题是我自己没有填充查询:XMPPFramework对此负责。该框架生成最终的XML,我只能提供字段和结果集。提供的字段将在x元素内,提供的结果集将是队列中的单独元素。但是如何通过XMPPFramework通过XMPPMessageArchiveManagement向队列提供
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)