Removed two fmt.Sprintf() calls and a fmt.Printf() call. The Printf()
was for debugging and isn't needed anymore. Sprintf() apparently
isn't all that performant.
The broadcast code would lock up eventually after a lot of messages.
It was rewritten to simplify and make it a bit more robust. Chat
should no longer seize up for individual chatters or the entire room
after a lot of messages.
Single-use moderator passwords can only be generated by an admin with
the /modpass command. To redeem the password and gain moderator
privileges, a user just needs to call /auth with the password.
The passwords are generated using the same function as the admin
password. Additionally, generating passwords now uses crypto/rand
instead of math/rand.
Resolves#15
Implement some commands in the wasm client code:
- /playing (setting and clearing)
- /refreshplayer
Commands not yet implemented:
- /purge (command doesn't exist yet on server)
- /help (doesn't open window)
handlePublish, handlePlay, and handleDefault have been added in
handlers.go and removed as anonymous functions in main.go. This also
required moving some struct and variable definitions around a bit.
Instead of using a GET value in the URL, split on the path separators
and use the second element of the path as the key. This enables
putting the stream key in the appropriate settings in OBS, instead of
appending it to the stream URL manually.
This broke when moving to the standard library for escaping and
unescaping HTML. The original escaping code replaced "//" with
"&x2F;&x2F;" while the standard library doesn't.
This still needs a bunch of work, but this should be OK until the UI is
rewritten.
The command injects a <script> tag to open up a new window. Mod and
admin commands are only shown to mods and admins (no authentication
happens for this).
Resolves#8 for now.
Don't allow the user to randomize their color if it was previously
changed by an mod. And don't change to a random color if an incorrect
argument was given for the command.