powered by Jive Software

Chat History Using Smack

android

#1

Hi,

I have implemented chat with Smack 4.1.0 for React Native.I am sending a following stanza ,

<iq id=“downloadMessages” type=“get”> <query xmlns=“urn:xmpp:mam:tmp”> <with>user1@serverdomain.com</with> <set xmlns=“http://jabber.org/protocol/rsm”/> </query> </iq>

and, I am receiving following data,

{“from”:“MyUser@serverdomain.com”,“body”:null,“src”:"<message to=‘MyUser@serverdomain.com/3fb36b4ca0a5c’ from=‘MyUser@serverdomain.com’><thread>ThreadID</thread><result xmlns=‘urn:xmpp:mam:tmp’><archived></archived><request></request><delay></delay><stanza-id></stanza-id><active></active><body>My MESSAGE</body></result></message>",“subject”:null,“thread”:“ThreadId”}

When I get a chat history, I do not get the JID and I get only my JID for all messages. SO , in this case I am unable to get the name of the person (JID) with whom I have chatted.
Any help will be appreciated.


#2

Hi, the data I receive from server consists of the sender JID.

<message to="241099@imserver/Smack"><result xmlns="urn:xmpp:mam:1" queryid="daab400b-2c28-4033-9621-263c4a890914" id="15"><forwarded xmlns="urn:xmpp:forward:0"><delay xmlns="urn:xmpp:delay" stamp="2018-10-31T06:24:08.419Z"/><message xmlns="jabber:client" to="241099@imserver" id="154096705032733122" type="chat" from="281001@imserver/Smack"><thread>a705cc85-138b-4c68-9692-d53dcc685b71</thread><body>MY MESSAGE</body><request xmlns="urn:xmpp:receipts"></request></message></forwarded></result></message>

I use MamManager.MamQueryResult mamQueryResult = mamManager.page(form, rsmSet) in Smack 4.3.2. Not too sure if it’s the same as Smack 4.1.0.