Add nick URL param

Closes: https://todo.sr.ht/~emersion/gamja/40
This commit is contained in:
Simon Ser 2021-05-27 12:32:22 +02:00
parent 37492e319b
commit 45c12fb684
2 changed files with 8 additions and 1 deletions

View file

@ -46,7 +46,11 @@ This will start a development HTTP server for gamja. Connect to it and append
gamja settings can be overridden using URL query parameters: gamja settings can be overridden using URL query parameters:
- `server`: path or URL to the WebSocket server - `server`: path or URL to the WebSocket server
- `channels`: comma-separated list of channels to join - `nick`: nickname
- `channels`: comma-separated list of channels to join (`#` needs to be escaped)
Alternatively, the channels can be set with the URL fragment (ie, by just
appending the channel name to the gamja URL).
## Configuration file ## Configuration file

View file

@ -253,6 +253,9 @@ export default class App extends Component {
connectParams.serverURL = queryParams.server; connectParams.serverURL = queryParams.server;
} }
} }
if (queryParams.nick) {
connectParams.nick = queryParams.nick;
}
if (queryParams.channels) { if (queryParams.channels) {
connectParams.autojoin = queryParams.channels.split(","); connectParams.autojoin = queryParams.channels.split(",");
} }