【发布时间】:2012-07-08 23:26:25
【问题描述】:
我正在使用 XMPP 和 openfire 服务器为 iPhone 开发一个聊天应用程序,OpenFire 服务器正在存储用户之间的所有聊天历史记录,但是当我尝试检索特定用户的聊天历史记录时,我只得到日期和聊天次数消息,但不是实际的短信
我已经安装了用于在 openfire 上存档消息的开放存档插件
这是我传递给 Openfire Server 的节
<iq type='get' id='pk1'>
<list xmlns='urn:xmpp:archive'
with='piyush@openfire'>
<set xmlns='http://jabber.org/protocol/rsm'>
<max>30</max>
</set>
</list>
</iq>
这是我从服务器收到的结果
<iq type="result" id="pk1" to="vivek@openfire/iphone">
<list xmlns="urn:xmpp:archive">
<chat with="piyush@openfire" start="2012-07-04T13:16:12.291Z"/>
<chat with="piyush@openfire" start="2012-07-05T08:25:31.555Z"/>
<chat with="piyush@openfire" start="2012-07-05T12:38:24.098Z"/>
<set xmlns="http://jabber.org/protocol/rsm">
<first index="0">15</first>
<last>25</last>
<count>3</count>
</set>
</list>
</iq>
这是我想要的也是我期望的结果
<iq type='result' to='vivek@openfire/iphone' id='page1'>
<chat xmlns='urn:xmpp:archive'
with='piyush@openfire'
start='2012-07-04T13:16:12.291Z'
subject='She speaks!'
version='4'>
<from secs='0'><body>Art thou not Romeo, and a Montague?</body></from>
<to secs='11'><body>Neither, fair saint, if either thee dislike.</body></to>
.
[98 more messages]
.
<from secs='9'><body>How cam'st thou hither, tell me, and wherefore?</body></from>
<set xmlns='http://jabber.org/protocol/rsm'>
<first index='0'>0</first>
<last>99</last>
<count>217</count>
</set>
请帮助我得到想要的结果
谢谢
【问题讨论】:
-
我认为这更像是一个 OpenFire API 问题而不是 iOS 问题。
-
嘿 piyush,我也试图实现同样的目标。但是(请原谅我的无知)我不知道如何将这节发送到 openfire 服务器。是否有 api 调用?你介意详细说明一下
-
@Piyush Kashyap 你是如何启用聊天记录的,因为我已经安装了
monitoring插件,但是当我在节上方触发时,它返回未实现的功能 -
请看一下:stackoverflow.com/a/29097289/2225439希望对您有所帮助。
-
@KeithOYS,兄弟你能帮我解决这个问题stackoverflow.com/questions/44172852/… 吗?
标签: ios xmpp openfire xmppframework