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.
Currently long topics will cause the buffer header to take up an
arbitrarily large percentage of the screen on mobile. Additionaly, long
words like URLS are not broken and may cause the buffer header to extend
outside of the viewport in the x direction, rendering the buffer content
unreadable.
This patch fixes these two issues by limiting the buffer header size to
20% of the viewport and breaking long words such as URLs if they would
overflow.
Fixes: https://todo.sr.ht/~emersion/gamja/129
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.
Add a baseline CSP applicable to all gamja deployments. Resources
can only be loaded from the current host, frames and objects are
disallowed, and scripts are allowed to connect to any host (to allow
cross-site WebSocket connections).
If the server returns a different CSP via an HTTP header, the
effective CSP will be the intersection.
The intent of the auto-join field is to ask the user whether they
really want to join the pre-filled channel. Users rarely want to
customize this field, they can just manually click "Join" after
connecting if they want to join another channel.