~emersion/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH gamja] Add "webircgateway" config for QoL tweaks

Details
Message ID
<20210610152728.9768-1-sir@cmpwn.com>
DKIM signature
pass
Download raw message
Patch: +21 -2
Right now all this does is marks the password field on the login form as
optional.
---
 README.md                  |  3 +++
 components/app.js          | 10 +++++++++-
 components/connect-form.js | 10 +++++++++-
 3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 7100e46..b9bd2cf 100644
--- a/README.md
+++ b/README.md
@@ -85,6 +85,9 @@ gamja default settings can be set using a `config.json` file at the root:
		"url": "wss://irc.example.org",
		// Channel(s) to auto-join (string or array of strings).
		"autojoin": "#gamja",
		// Set to true if you're using webircgateway. Optional; this just
		// enables some quality-of-life features.
		"webircgateway": false,
		// Interval in seconds to send PING commands (number). Set to 0 to
		// disable. Enabling PINGs can have an impact on client power usage and
		// should only be enabled if necessary.
diff --git a/components/app.js b/components/app.js
index 920cb90..c8b1966 100644
--- a/components/app.js
+++ b/components/app.js
@@ -100,6 +100,7 @@ export default class App extends Component {
			autoconnect: false,
			autojoin: [],
		},
		webircgateway: false,
		servers: new Map(),
		buffers: new Map(),
		bouncerNetworks: new Map(),
@@ -200,7 +201,13 @@ export default class App extends Component {
		}

		this.setState((state) => {
			return { connectParams: { ...state.connectParams, ...connectParams } };
			return {
				connectParams: {
					...state.connectParams,
					...connectParams,
				},
				webircgateway: config.server.webircgateway === true,
			};
		});

		if (connectParams.autoconnect) {
@@ -1193,6 +1200,7 @@ export default class App extends Component {
					<${ConnectForm}
						error=${this.state.error}
						params=${this.state.connectParams}
						webircgateway=${this.state.webircgateway}
						connecting=${connecting}
						onSubmit=${this.handleConnectSubmit}
						key=${this.state.connectParams}
diff --git a/components/connect-form.js b/components/connect-form.js
index 4deb947..17edf12 100644
--- a/components/connect-form.js
+++ b/components/connect-form.js
@@ -10,6 +10,7 @@ export default class ConnectForm extends Component {
		username: "",
		realname: "",
		autojoin: "",
		webircgateway: false,
	};

	constructor(props) {
@@ -27,6 +28,7 @@ export default class ConnectForm extends Component {
				username: props.params.username || "",
				realname: props.params.realname || "",
				autojoin: (props.params.autojoin || []).join(","),
				webircgateway: props.webircgateway,
			};
		}
	}
@@ -110,7 +112,13 @@ export default class ConnectForm extends Component {

				<label>
					Password:<br/>
					<input type="password" name="password" value=${this.state.password} disabled=${disabled}/>
					<input
						type="password"
						name="password"
						value=${this.state.password}
						disabled=${disabled}
						placeholder=${this.state.webircgateway ? "(optional)" : ""}
					/>
				</label>
				<br/><br/>

-- 
2.32.0
Details
Message ID
<Mi3HMBZqr98X_NT1I2eFNa6tVUII14Mqt9Xvw0U9qnhIPAADv95b4Tzq4NprpPwrQ5bAy0LAfKl90cL0cfXU1CltEqFSbOVLE65ComzjdT8=@emersion.fr>
In-Reply-To
<20210610152728.9768-1-sir@cmpwn.com> (view parent)
DKIM signature
pass
Download raw message
webircgateway usage doesn't mean that password auth is optional. Some
networks have mandatory auth, some networks don't have auth at all.

Maybe we should just add a "auth" field which can be set to
"mandatory", "optional" or "disabled"?
Reply to thread Export thread (mbox)