From 45c12fb684532544319284308425f94a8babc601 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 27 May 2021 12:32:22 +0200 Subject: [PATCH] Add nick URL param Closes: https://todo.sr.ht/~emersion/gamja/40 --- README.md | 6 +++++- components/app.js | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ac1ecc8..91dbbbb 100644 --- a/README.md +++ b/README.md @@ -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: - `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 diff --git a/components/app.js b/components/app.js index 03830ef..bee821f 100644 --- a/components/app.js +++ b/components/app.js @@ -253,6 +253,9 @@ export default class App extends Component { connectParams.serverURL = queryParams.server; } } + if (queryParams.nick) { + connectParams.nick = queryParams.nick; + } if (queryParams.channels) { connectParams.autojoin = queryParams.channels.split(","); }