Rantanen / node-mumble

Mumble client in Node.js
MIT License
155 stars 48 forks source link

How do I set the comment for the connected user? #93

Closed jmurth1234 closed 8 years ago

jmurth1234 commented 8 years ago

I had a look at the code of the project, and there seems to be no way to set the comment of the user connected with node-mumble.

How would I go about doing this?

tjhorner commented 8 years ago

I haven't tested this, but this should probably work:

client.connection.sendMessage( 'UserState', { session: client.user.session, actor: client.user.session, comment: "the comment of the user" } );

Where client is your MumbleClient instance. I can send a pull request to make this easier, if you'd like :)

tjhorner commented 8 years ago

Also note that if you want to get a user's comment, it's slightly more complicated. You'd need to check if comment_hash exists, then send a RequestBlob with the user's session and then respond to the new UserState accordingly.

jmurth1234 commented 8 years ago

That code worked perfectly, thanks!

tjhorner commented 8 years ago

I made a PR (#94) so you'll soon be able to use User.setComment

jmurth1234 commented 8 years ago

Thanks! Probably will help the next person who wants to set a comment :)