本文介绍了获取XMPP聊天记录OpenFire的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用OpenFire服务器在iOS中使用XMPPFramework实现聊天应用程序。我的聊天工作正常,我正在尝试从服务器检索聊天记录。当然,我已在服务器上启用了消息存档。这是我发送的请求

I am trying to implement a chat application using XMPPFramework in iOS, using OpenFire server. My chat is working fine, I am trying to retrieve chat history from server. Ofcourse I have enabled Message Archiving on Server. This is the Request I am sending

<iq type="get">
   <retrieve xmlns="urn:xmpp:archive" with="dev_user80@mydomain">
       <set xmlns="http://jabber.org/protocol/rsm">
           <max>100</max>
       </set>
   </retrieve>
</iq>

这是我得到的回复。

<iq xmlns="jabber:client" type="error" to="dev_user103@mydomain/6i0qoo9tek">
    <retrieve xmlns="urn:xmpp:archive" with="dev_user80@mydomain">
        <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>

我已经完成了我在互联网上找到的所有解决方案,但找不到令人满意的解决方案

I have gone through all the solutions I could find on the internet but could not find a satisfying solution

推荐答案

urn:xmpp:archive 更改为 urn:xmpp:archive:auto

我遇到了同样的问题,并通过运行发现请求来确定:

I had the same issue and determined this by running a discovery request: http://xmpp.org/extensions/xep-0136.html#disco

我发送了这个IQ:

<iq from='[email protected]'
    id='disco1'
    to='mydomain.com'
    type='get'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>

启用监控插件的我的Openfire服务器返回此结果:

My Openfire server with the Monitoring plugin enabled returned this result:

<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 :手动)和存档首选项( urn:xmpp:archive:pref )不是。

You can see that Automatic Archiving (urn:xmpp:archive:auto) and Archive Management (urn:xmpp:archive:manage) are supported, but Manual Archiving (urn:xmpp:archive:manual) and Archiving Preferences (urn:xmpp:archive:pref) are not.

也支持XEP-0313(列为 urn:xmpp:mam:0 )并且可以检索存档的消息:

XEP-0313 is also supported (listed as urn:xmpp:mam:0) and can retrieve archived messages: http://xmpp.org/extensions/xep-0313.html

这篇关于获取XMPP聊天记录OpenFire的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 22:02