Add config option to generate random nickname

Closes: https://todo.sr.ht/~emersion/gamja/136
This commit is contained in:
Simon Ser 2022-09-12 13:04:59 +02:00
parent 34d3bd6df9
commit 54e1fc93d9
2 changed files with 10 additions and 1 deletions

View file

@ -323,6 +323,14 @@ export default class App extends Component {
this.config = config;
if (!connectParams.nick && connectParams.autoconnect) {
connectParams.nick = "user-*";
}
if (connectParams.nick && connectParams.nick.includes("*")) {
let placeholder = Math.random().toString(36).substr(2, 7);
connectParams.nick = connectParams.nick.replace("*", placeholder);
}
if (autojoin.length > 0) {
if (connectParams.autoconnect) {
// Ask the user whether they want to join that new channel.