While fetching Chat History I am Not getting Both user History from Openfire

后端 未结 1 941
情歌与酒
情歌与酒 2021-01-17 13:37

I fetched History from openfire by installing open fire plugin in the open fire and tried this code.

let iq1 = DDXMLElement(name: \"iq\")
    iq1.addAttribut         


        
1条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-17 14:06

    I have implemented the same to get the Message to and from by sending the given iq And I am getting the proper result.

    let iQ = DDXMLElement.element(withName: "iq") as! DDXMLElement
            iQ.addAttribute(withName: "type", stringValue: "get")
                    iQ.addAttribute(withName: "id", stringValue: (xmppHandler.xmppStream?.generateUUID())!)
            let retrieve = DDXMLElement(name: "retrieve", xmlns: "urn:xmpp:archive")
            retrieve?.addAttribute(withName: "with", stringValue: "\(JID!)@\(Utility.hostname)")
    
            let set = DDXMLElement.element(withName: "set") as! DDXMLElement
            set.addAttribute(withName: "xmlns", stringValue: "http://jabber.org/protocol/rsm")
            let max = DDXMLElement.element(withName: "max") as! DDXMLElement
            max.stringValue = "10"
            max.addAttribute(withName:"xmlns", stringValue: "http://jabber.org/protocol/rsm")
    
            iQ.addChild(retrieve!)
            retrieve?.addChild(set)
            set.addChild(max as DDXMLNode)
            xmppHandler.xmppStream?.send(iQ)
    
    10
    

    Response

        
      
        
          Hiii rajeev
        
        
          Hi
            How r u
        
       I am good
       What abt u
       Hello testing chat
       Good
       Continue 
       Ok
        
       Nice chat
        
       Heelo
       0     9574
    

    0 讨论(0)
提交回复
热议问题