client.setPingInterval was only called once in app.connect(),
but client.disconnect() disables it, and the ping timer is never again set,
even though the client can reconnect.
the change passes the ping time as a parameter to the client, and the
client calls setPingInterval() after a successful WS open event.
This commit changes the composer to not be read-only on the server
buffer, which tells the user that they can send commands from that view.
On the server buffer, the placeholder is changed to
"Type a command (see /help)", which indicates to the user that this buffer
only accepts commands, and gives them a hint for how to learn what
commands are available.
Implements: https://todo.sr.ht/~emersion/gamja/38
console.debug logs cause some performance issues because the browser
is forced to save the logged objects just in case the user opens the
debugging tools.
They can be force-enabled back by adding ?debug=1 to the URL.
Only console.debug is disabled, console.log and other levels are a lot
less verbose and still enabled by default.
If the server supports SASL and if we aren't logged in with any
account, add a UI to authenticate via SASL. This allows users to
login anonymously then login via SASL.
This will also ease the draft/account-registration implementation.
Some servers allow fetching history from some targets but not
others. Don't completely stop fetching chat history on error.
The root cause was a variable shadowing in Client.fetchBatch.
When the server supports draft/event-playback, some messages (like
join/part/etc) may be collapsed together. Request more messages to
avoid ending up with a half-filled page.
This splits handleMessage into two functions: one decides in which
buffers the message should be appended to, the other performs
message side-effects like auto-join.