10
讓這兩個用戶的歷史我拿來的歷史從Openfire的由明火安裝明火插件,並試圖此代碼。在拿聊天記錄我不是從Openfire的
let iq1 = DDXMLElement(name: "iq")
iq1.addAttribute(withName: "type", stringValue: "get")
iq1.addAttribute(withName: "id", stringValue: "0")
let retrieve = DDXMLElement(name: "retrieve", xmlns: "urn:xmpp:archive")
retrieve?.addAttribute(withName: "with", stringValue: "[email protected]")
let set = DDXMLElement(name: "set", xmlns: "http://jabber.org/protocol/rsm")
let max = DDXMLElement(name: "max", stringValue: "50")
iq1.addChild(retrieve!)
retrieve?.addChild(set!)
set?.addChild(max)
stream?.send(iq1)
現在我沒有從雙方獲得歷史。這是我得到的結果。
<iq xmlns="jabber:client"
type="result"
id="0"
to="[email protected]/5qsinh1syg">
<chat xmlns="urn:xmpp:archive"
with="[email protected]"
start="2017-02-07T06:28:33.691Z">
\t <from secs="0">
\t <body>hello</body>
\t </from>
\t <from secs="405">
\t <body>hiii</body>
\t </from>
\t <from secs="580">
\t <body>Hey</body>
\t </from>
\t <from secs="599">
\t <body>HooooE</body>
\t </from>
\t <from secs="628">
\t <body>hOo</body>
\t </from>
\t <from secs="907">
\t <body>Raman here</body>
\t </from>
\t
\t <from secs="931">
\t <body>Raman here ONE</body>
\t </from>
\t <from secs="1273">
\t <body>Raman here</body>
\t </from>
\t <from secs="1558">
\t <body> Raman from SPark </body>
\t </from>
\t <from secs="1571">
\t <body> Raman from SPark One</body>
\t </from>
\t <from secs="1782">
\t <body>Raman from SPark </body>
\t </from>
\t <from secs="2651">
\t <body>Raman FiVE</body>
\t </from>
\t <from secs="2810">
\t <body>Raman Three</body>
\t </from>
\t <from secs="2810">
\t <body>Raman FOur</body>
\t </from>
\t <from secs="3534">
\t <body>RAMAN SIX</body>
\t </from>
\t <from secs="4105">
\t <body>Raman OKK</body>
\t </from>
\t <from secs="4113">
\t <body>OKKK l</body>
\t </from>
\t <from secs="4130">
\t <body>UST</body>
\t </from>
\t <set xmlns="http://jabber.org/protocol/rsm">
\t \t <first index="0">0</first>
\t \t <last>17</last>
\t \t <count>18</count>
\t </set>
</chat>
</iq>
這是拉曼所有信息不BENTICk因爲這兩個用戶參與聊天的同時獲得歷史我只得到拉曼消息。不是BENTICk 如何從雙方用戶獲取歷史記錄。
請幫忙。
您使用LDAP或內置的Openfire數據庫? – OlaB
它是默認的openfire數據庫。 –
是否允許從服務器>服務器設置 - >消息審覈策略啓用消息審覈? – OlaB