Schamper/nodebb-plugin-shoutbox — pull request #50 by JherNifol (2014-07-06 19:35:35+00:00)
Title: Update backend.js

With a recent install of the most up to date NodeBB, using Redis and the essentials, along with plugins soundcloud, card, emailer-mandrill, mentions, featured-threads, custom-homepage...

I was having issues with the shoutbox, and they were:
Shoutbox would load, and seemingly connect, however nothing would be displayed on load (inside shoutbox, i.e. welcome message thingy). In the browser console it was giving me 502s, bad gateway, etc.
Checked my database and the shout:*, shouts, and global nextShout were being entered.
However, when trying to get the shouts, there were errors from this section of code that were crashing my nodejs instance and causing a restart every time shouts were queried. Along with the shouts never making it back to the front end.

Line 90, when getting the "uids.indexOf(...)", needed to parseInt on the "shout.fromuid" for it to work properly on my end.

I'm not sure about "shout._key.split(':')[1];", particularly "_key", as it was undefined on my end and causing an error when trying to get/add the sid.

There's probably a better way to add the sid here, perhaps simply add the sid to the shout on lines 17-22, or use a more clever way to set the sid in this section of code, but this worked for me.

I've never done a pull before and I'm kind of a noob, so forgive if this is dumb, but it did fix my shoutbox.

Note: I'm still getting "warn: [socket.io] Unrecognized message: modules.shoutbox.removeAll" when attempting to remove deleted shouts, or remove all shouts from the acp.