i built a react client-side app for ejabberd using xmpp-react , everything is working fine so far, I can chat between 2 users, and now I'm trying to fetch the chat history between 2 users, I searched google for this found some examples and articles related to this, here are links I followed
here is the code I have tried
await xmppData.send(
xml(
"iq",
{
type: "set",
to: "admin@chats.samaaro.com",
from: userData.email,
id: xmppData.jid._resource,
},
xml(
"query",
{
xmlns: "urn:xmpp:mam:1",
queryid: queryId,
},
xml(
"x",
{
xmlns: "jabber:x:data",
type: "submit",
},
xml(
"field",
{
var: "FORM_TYPE",
type: "hidden",
},
xml("value", {}, "prasanna@example.com")
)
)
)
)
);
in response I'm getting like below
attrs: {xmlns: 'http://jabber.org/protocol/rsm'} children: Array(3) 0: Element attrs: {} children: ['821'] name: "count" parent: Element {name: 'set', parent: Element, children: Array(3), attrs: {…}} [[Prototype]]: Object 1: Element attrs: {} children: ['1648729284714751'] name: "first" parent: Element {name: 'set', parent: Element, children: Array(3), attrs: {…}} [[Prototype]]: Object 2: Element attrs: {} children: ['1652268849881814'] name: "last" parent: Element {name: 'set', parent: Element, children: Array(3), attrs: {…}} [[Prototype]]: Object length: 3 [[Prototype]]: Array(0) name: "set"
the question is why I'm getting the count, last, and first instead of the chat history, and how can I get the previous chats instead of the count, first, last?
any help or suggestions are really appreciated