simple-xmpp / node-simple-xmpp

Simple High Level NodeJS XMPP Client
302 stars 90 forks source link

messages repeated in group chat #64

Open navjeetc opened 8 years ago

navjeetc commented 8 years ago

I am writing a curl script that calls express/node.js url to send a message to a group chat room. All my logic to send message to group chat is in online callback.

xmpp.on('online', function() {
chat_room = req.body.chat_room + '@conference.chat.domain.com'; xmpp.join(chat_room+'/batman'); xmpp.send(chat_room, req.body.content, true); });

When I call the curl script twice, I see three messages being posted (second call also posts the message from first call) to group chat room. Is there a clean way to close connection or leave chat room after sending each message to group chat room?

ofleaf commented 8 years ago

I have same problem. how did you solved?

silverbucket commented 8 years ago

I'm not actively developing the library at the moment, pull requests always welcome though!

ofleaf commented 8 years ago

I'm solved :) I didn't input nickname to xmpp.join command.

xmpp.join(room + host + '/nickname');