0
votes

I am using strophe.js and ejabberd for implementing a chat in my site. But I couldn't successfully send a message or retrieve messages using mam. The log is printing the SENT: and RECV: strings. The code I am using to send a message is

var m = $msg({to: 'admin@ks111', from: 'admin@ks111', type: 'chat'}).c("body").t('body'); connection.send(m);

and the SENT string obtained is

SENT: <body rid='3431080199' xmlns='http://jabber.org/protocol/httpbind'><enable xmlns='urn:xmpp:sm:3' resume='false'/><message to='user1@server' from='user2@server' type='chat' xmlns='jabber:client'><body>body</body></message></body>

I tried with the gajim client for no response. But if I am removing the 'body' tag like...

<message to='user1@server' from='user2@server' type='chat' xmlns='jabber:client'><body>body</body></message>

the chat is received properly. The 'body' tag is added with all the requests by default. What could be the issue. Please provide a solution.

1

1 Answers

0
votes

body should only be added by library implementing XMPP over BOSH. They are part of the BOSH control structure and signalling. I presume your Strophe client use BOSH so having a BOSH wrappers is expected. I also supposed that your are connecting using standard XMPP using Gajim, so you need to use standard XMPP without BOSH wrapper. Otherwise, it is not understood as an XMPP packet (a body tag is not a valid XMPP packet).

All seems normal and expected.