获取XMPP聊天记录OpenFire
问题描述:
我想在iOS中使用OpenFire服务器实现使用XMPPFramework的聊天应用程序。我的聊天工作正常,我试图从服务器检索聊天记录。当然,我在服务器上启用了消息存档功能。这是我要发送的请求获取XMPP聊天记录OpenFire
<iq type="get">
<retrieve xmlns="urn:xmpp:archive" with="[email protected]">
<set xmlns="http://jabber.org/protocol/rsm">
<max>100</max>
</set>
</retrieve>
</iq>
这是我得到的回应。
<iq xmlns="jabber:client" type="error" to="[email protected]/6i0qoo9tek">
<retrieve xmlns="urn:xmpp:archive" with="[email protected]">
<set xmlns="http://jabber.org/protocol/rsm">
<max>100</max>
</set>
</retrieve>
<error code="503" type="cancel">
<service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">
</service-unavailable>
</error>
</iq>
我已经完成了所有的解决方案,我可以在互联网上找到了,但无法找到一个令人满意的解决方案
答
变化urn:xmpp:archive
到urn:xmpp:archive:auto
我有同样的问题,并通过运行确定这发现请求:http://xmpp.org/extensions/xep-0136.html#disco
我发这个智商:
<iq from='[email protected]'
id='disco1'
to='mydomain.com'
type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
与监控插件
我的Openfire服务器启用了返回这个结果:
<iq xmlns="jabber:client" type="result" id="disco1" from="mydomain.com" to="[email protected]/resource">
<query xmlns="http://jabber.org/protocol/disco#info">
<identity category="server" name="Openfire Server" type="im" />
<identity category="pubsub" type="pep" />
<feature var="http://jabber.org/protocol/pubsub#retrieve-default" />
<feature var="http://jabber.org/protocol/pubsub#purge-nodes" />
<feature var="vcard-temp" />
<feature var="http://jabber.org/protocol/pubsub#subscribe" />
<feature var="http://jabber.org/protocol/pubsub#subscription-options" />
<feature var="http://jabber.org/protocol/pubsub#create-nodes" />
<feature var="http://jabber.org/protocol/pubsub#outcast-affiliation" />
<feature var="msgoffline" />
<feature var="http://jabber.org/protocol/pubsub#get-pending" />
<feature var="http://jabber.org/protocol/pubsub#multi-subscribe" />
<feature var="http://jabber.org/protocol/pubsub#presence-notifications" />
<feature var="urn:xmpp:ping" />
<feature var="jabber:iq:register" />
<feature var="http://jabber.org/protocol/pubsub#delete-nodes" />
<feature var="http://jabber.org/protocol/pubsub#config-node" />
<feature var="urn:xmpp:archive:manage" />
<feature var="http://jabber.org/protocol/pubsub#retrieve-items" />
<feature var="http://jabber.org/protocol/pubsub#auto-create" />
<feature var="http://jabber.org/protocol/disco#items" />
<feature var="http://jabber.org/protocol/pubsub#item-ids" />
<feature var="http://jabber.org/protocol/pubsub#meta-data" />
<feature var="urn:xmpp:mam:0" />
<feature var="jabber:iq:roster" />
<feature var="http://jabber.org/protocol/pubsub#instant-nodes" />
<feature var="http://jabber.org/protocol/pubsub#modify-affiliations" />
<feature var="http://jabber.org/protocol/pubsub#persistent-items" />
<feature var="http://jabber.org/protocol/pubsub#create-and-configure" />
<feature var="http://jabber.org/protocol/pubsub" />
<feature var="http://jabber.org/protocol/pubsub#publisher-affiliation" />
<feature var="http://jabber.org/protocol/pubsub#access-open" />
<feature var="http://jabber.org/protocol/pubsub#retrieve-affiliations" />
<feature var="jabber:iq:version" />
<feature var="http://jabber.org/protocol/pubsub#retract-items" />
<feature var="urn:xmpp:time" />
<feature var="http://jabber.org/protocol/pubsub#manage-subscriptions" />
<feature var="jabber:iq:privacy" />
<feature var="jabber:iq:last" />
<feature var="http://jabber.org/protocol/commands" />
<feature var="http://jabber.org/protocol/offline" />
<feature var="urn:xmpp:carbons:2" />
<feature var="http://jabber.org/protocol/address" />
<feature var="http://jabber.org/protocol/pubsub#publish" />
<feature var="http://jabber.org/protocol/pubsub#collections" />
<feature var="http://jabber.org/protocol/pubsub#retrieve-subscriptions" />
<feature var="urn:xmpp:archive:auto" />
<feature var="http://jabber.org/protocol/disco#info" />
<feature var="jabber:iq:private" />
<feature var="http://jabber.org/protocol/rsm" />
</query>
</iq>
可以看到,自动存档(urn:xmpp:archive:auto
)与档案管理(urn:xmpp:archive:manage
)的支持,但手动归档(urn:xmpp:archive:manual
)和归档首选项( urn:xmpp:archive:pref
)不是。
XEP-0313还支持(列为urn:xmpp:mam:0
),并可以检索存档的消息:http://xmpp.org/extensions/xep-0313.html
你得到任何解决方案?或者你可以请看看这个问题http://stackoverflow.com/questions/41503601/getting-error-while-fetching-archived-messagesxep-0313-mam-chat-history-from – Chitrang
服务不可用意味着您需要安装打开消防插入到明火服务器 –
@Chitrang不,我没有找到任何解决方案。 –