simple-xmpp / node-simple-xmpp

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

Add support for MUC #11

Closed MiLk closed 11 years ago

MiLk commented 11 years ago

This changes allow the client to join Multi User Chat. To send a message in a groupchat, you must set the third parameter of send method to 1. An groupchat event is fired when a message is sent to groupchat.

This feature was asked on issue #3.

mutil commented 11 years ago

Hi MiLk, I used your patch and it worked fine for me. There is just a typo at line 159, where conference and id get the same value. Also, at line 61, it may be better with something like type: (group || 'chat'), in case someone sends 'groupchat' and 'chat' strings as the third variable.

arunoda commented 11 years ago

Hi, Thanks for the update.

I think we don't need check for strings in like 61. Passing a true or 1 is quite simple. Hope people read the docs.

@MiLk as @mutil said, can you please double check the line 159 where it takes the same value for id and conference. Is this done purposely or is it a typo?

BTW: Can you please add some docs on the README for both the send and the event.

MiLk commented 11 years ago

I'll check for the line 159 asap. I made the changes 4 months ago and don't remember how it should be. But it's used each day (and works fine) on production system that use xmpp for lot of things ;)

MiLk commented 11 years ago

Hi,

Indeed, there was an error at line 159. The messages are close to those available on this link: http://xmpp.org/extensions/xep-0045.html#enter-history

I added some documentation on the README and an example too.

ghost commented 11 years ago

I'm using this and it is pretty rad. Thanks, @MiLk!

arunoda commented 11 years ago

@MiLk please consider #21

silverbucket commented 11 years ago

I've merged this based on a quick review and user comments that others have been using it! @MiLk - if you've done any other work/bugfixes on your branch since then, please send another pull request!