CyTube has been crashing recently due to things attempting to release
the reference after the channel was already closed (apparently the
uncaughtException handler isn't called for this?). This newer
implementation keeps track of what is ref'ing and unref'ing it, so it
can log an error if it detects a discrepancy.
Also changed the server to not delete the refCounter field from the
channel when it's unloaded, so that should reduce the number of errors
stemming from it being null/undefined.
When the changeMedia frame loads a new Google Drive video, @yt is still
set from before and moreover @yt.ready is still true, so calling play()
can result in a TypeError if the new embed hasn't loaded yet (this
seemed to happen consistently in Chrome and I was unable to make it
happen in Firefox).
`uid` is used twice, where it should be `uid` and `gid`, resulting in an attempted execution of something like `id -g 1500` rather than `id -g syncgroup`. These variable names are already confusing due to the nature of the functions, so I made it clear they're strings rather than numeric IDs.
The previous behavior (don't autoscroll if the mouse is over the chat
area) was not intuitive and caused problems for people in chat only
mode, which led to a lot of people assuming that it was a glitch.
This change introduces the following behavior:
* Hovering over chat no longer affects autoscroll.
* Scrolling up in chat turns off autoscroll.
* Scrolling to the bottom of the chatbox resumes autoscroll.
* If a new message is added while autoscroll is off, a "New Messages
Below" indicator is added to the bottom of the chatbox.