aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.build.yml19
-rw-r--r--.editorconfig2
-rw-r--r--.gitignore1
-rw-r--r--README.md8
-rw-r--r--components/connect-form.js4
-rw-r--r--config.json6
-rw-r--r--lib/client.js17
-rw-r--r--style.css4
-rwxr-xr-xupload9
9 files changed, 36 insertions, 34 deletions
diff --git a/.build.yml b/.build.yml
deleted file mode 100644
index aae837e..0000000
--- a/.build.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-image: alpine/latest
-packages:
-- npm
-- rsync
-sources:
-- https://git.sr.ht/~emersion/gamja
-secrets:
-- 77c7956b-003e-44f7-bb5c-2944b2047654 # deploy SSH key
-tasks:
-- setup: |
- cd gamja
- npm install --include=dev
- npm run build
-- deploy: |
- cd gamja/dist
- [ "$(git rev-parse HEAD)" = "$(git rev-parse origin/master)" ] || complete-build
- rsync --rsh="ssh -o StrictHostKeyChecking=no" -rP \
- --delete --exclude=config.json \
- . deploy@sheeta.emersion.fr:/srv/http/gamja
diff --git a/.editorconfig b/.editorconfig
index c229150..a1f064e 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -6,4 +6,4 @@ insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
indent_style = tab
-indent_size = 4
+indent_size = 8
diff --git a/.gitignore b/.gitignore
index 2230596..4f56fad 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,4 @@
node_modules
-/config.json
.parcel-cache
/dist
diff --git a/README.md b/README.md
index c7b87e2..e11229b 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,11 @@
+This is a soft fork of the [gamja](https://codeberg.org/emersion/gamja) IRC web
+client. We made a few small changes for the [rx](https://irc.runxiyu.org) IRC
+network. A public instance is available at <https://gamja.irc.andrewyu.org>.
+
+The upstream README is below.
+
+---
+
# [gamja]
A simple IRC web client.
diff --git a/components/connect-form.js b/components/connect-form.js
index 6eab2df..a5707f1 100644
--- a/components/connect-form.js
+++ b/components/connect-form.js
@@ -115,7 +115,7 @@ export default class ConnectForm extends Component {
if (this.props.auth !== "disabled" && this.props.auth !== "external" && this.props.auth !== "oauth2") {
auth = html`
<label>
- Password:<br/>
+ Password (SASL):<br/>
<input
type="password"
name="password"
@@ -148,7 +148,7 @@ export default class ConnectForm extends Component {
return html`
<form onInput=${this.handleInput} onSubmit=${this.handleSubmit}>
- <h2>Connect to IRC</h2>
+ <h2>Connect to the rx IRC network</h2>
<label>
Nickname:<br/>
diff --git a/config.json b/config.json
new file mode 100644
index 0000000..20b999d
--- /dev/null
+++ b/config.json
@@ -0,0 +1,6 @@
+{
+ "server": {
+ "autojoin": "#chat,#support",
+ "nick": "webirc-*"
+ }
+}
diff --git a/lib/client.js b/lib/client.js
index af5a33d..8915232 100644
--- a/lib/client.js
+++ b/lib/client.js
@@ -5,7 +5,6 @@ import * as irc from "./irc.js";
const permanentCaps = [
"account-notify",
"away-notify",
- "batch",
"chghost",
"echo-message",
"extended-join",
@@ -184,10 +183,6 @@ export default class Client extends EventTarget {
this.ws.addEventListener("close", (event) => {
console.log("Connection closed (code: " + event.code + ")");
- if (event.code !== NORMAL_CLOSURE && event.code !== GOING_AWAY) {
- this.dispatchError(new Error("Connection error"));
- }
-
this.ws = null;
this.setStatus(Client.Status.DISCONNECTED);
this.nick = null;
@@ -494,9 +489,11 @@ export default class Client extends EventTarget {
throw new IRCError(msg);
}
});
- for (let msg of irc.generateAuthenticateMessages(initialResp)) {
- this.send(msg);
- }
+ setTimeout(() => {
+ for (let msg of irc.generateAuthenticateMessages(initialResp)) {
+ this.send(msg);
+ }
+ }, 5000);
return promise;
}
@@ -686,7 +683,9 @@ export default class Client extends EventTarget {
this.send({ command: "BOUNCER", params: ["BIND", this.params.bouncerNetwork] });
}
- this.send({ command: "CAP", params: ["END"] });
+ setTimeout(() => {
+ this.send({ command: "CAP", params: ["END"] })
+ }, 8000);
}
break;
case "NEW":
diff --git a/style.css b/style.css
index b5b364e..4ed7089 100644
--- a/style.css
+++ b/style.css
@@ -55,7 +55,7 @@ body {
display: grid;
grid-template-rows: auto 1fr max-content;
grid-template-columns: max-content 1fr max-content;
- font-family: monospace;
+ font-family: "DejaVu Sans Mono", "Menlo", "SF Mono", monospace, "Courier";
}
noscript {
@@ -559,7 +559,7 @@ kbd {
text-align: center;
white-space: nowrap;
padding: 2px 4px;
- font-family: monospace;
+ font-family: "DejaVu Sans Mono", "Menlo", "SF Mono", monospace;
border-radius: 3px;
}
diff --git a/upload b/upload
new file mode 100755
index 0000000..5f72ab8
--- /dev/null
+++ b/upload
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -eux
+
+npm run build
+
+cp config.json dist/
+
+rsync --verbose --chmod=644 --recursive --delete-after dist/ root@andrewyu.org:/var/www/gamja/gamja/