0
votes

I have a stable xmpp chat implemented with smack library for android. I need to get the conversation history between two users, I found out that I can get the history by sending a raw xml IQ, but I couldn't find a way to do it using smack.

<iq type="get" id="pk1">
  <query xmlns="urn:xmpp:mam:tmp" with="user@domain" queryid="x01">
   <set xmlns="http://jabber.org/protocol/rsm">
    <max>100</max>
   </set>
  </query>
</iq>

Is there any other way I could get the history between two users without unsing a server? Thank you

2

2 Answers

0
votes

If you want to keep conversations history and without using server then you need to create local db in your Android App. You will keep track of sender, receiver, time and messageId. This way you can keep conversations history without calling server.

Although this type of history will go if you change your device. That is negative side of it.

0
votes

If you want to save history on your Server you need to connect your Server DB with XMPP Server DB using ODBC to maintain all messages