6 Commits

Author SHA1 Message Date
Simon Ser fd63c169ed lib/client: encode empty SASL response as "+" 2023-03-21 17:57:09 +01:00
Simon Ser 2c3fbdd605 readme: document default for server.url in config.json 2023-03-13 20:36:47 +01:00
Simon Ser 2883234ff6 Don't perform OAuth redirection after server meteadata error 2023-03-10 14:14:37 +01:00
Giorgi Taba Kobakhidze 4f350ae223 components/app: ensure msg.tags is initialized
Fixes the following error when sending a message on a server
without echo-message:

    Uncaught TypeError: t.tags is undefined
        prepareChatMessage app.js:602
        handleChatMessage app.js:616
        privmsg app.js:1514
        handleComposerSubmit app.js:1535
        handleSubmit composer.js:30
        Preact 15
        handleMessage app.js:1013
        connect app.js:791
        handleMessage client.js:448
        reconnect client.js:176
        reconnect client.js:174
        Yt client.js:151
        connect app.js:754
        handleConnectSubmit app.js:1279
        handleSubmit connect-form.js:74
        Preact 16
        handleConfig app.js:382
        <anonymous> app.js:238
        promise callback* app.js:237
        Preact 4
        <anonymous> main.js:4
2023-02-17 23:36:46 +01:00
Simon Ser f7459704f6 components/composer: focus composer on keydown if a link is active
Fixes message not typed after clicking on a link.
2023-01-31 18:28:51 +01:00
Simon Ser c6024e643a Upgrade dependencies 2023-01-16 12:10:31 +01:00
5 changed files with 1149 additions and 1004 deletions
+1 -1
View File
@@ -97,7 +97,7 @@ gamja default settings can be set using a `config.json` file at the root:
{ {
// IRC server settings. // IRC server settings.
"server": { "server": {
// WebSocket URL or path to connect to (string). // WebSocket URL or path to connect to (string). Defaults to "/socket".
"url": "wss://irc.example.org", "url": "wss://irc.example.org",
// Channel(s) to auto-join (string or array of strings). // Channel(s) to auto-join (string or array of strings).
"autojoin": "#gamja", "autojoin": "#gamja",
+5
View File
@@ -394,6 +394,7 @@ export default class App extends Component {
} catch (err) { } catch (err) {
console.error("Failed to fetch OAuth 2.0 server metadata:", err); console.error("Failed to fetch OAuth 2.0 server metadata:", err);
this.showError("Failed to fetch OAuth 2.0 server metadata"); this.showError("Failed to fetch OAuth 2.0 server metadata");
return;
} }
oauth2.redirectAuthorize({ oauth2.redirectAuthorize({
@@ -599,6 +600,10 @@ export default class App extends Component {
msg.isHighlight = irc.isHighlight(msg, client.nick, client.cm) || irc.isServerBroadcast(msg); msg.isHighlight = irc.isHighlight(msg, client.nick, client.cm) || irc.isServerBroadcast(msg);
} }
if (!msg.tags) {
// Can happen for outgoing messages for instance
msg.tags = {};
}
if (!msg.tags.time) { if (!msg.tags.time) {
msg.tags.time = irc.formatDate(new Date()); msg.tags.time = irc.formatDate(new Date());
} }
+8 -2
View File
@@ -118,8 +118,14 @@ export default class Composer extends Component {
handleWindowKeyDown(event) { handleWindowKeyDown(event) {
// If an <input> or <button> is focused, ignore. // If an <input> or <button> is focused, ignore.
if (document.activeElement !== document.body && document.activeElement.tagName !== "SECTION") { if (document.activeElement && document.activeElement !== document.body) {
return; switch (document.activeElement.tagName.toLowerCase()) {
case "section":
case "a":
break;
default:
return;
}
} }
// If a modifier is pressed, reserve for key bindings. // If a modifier is pressed, reserve for key bindings.
+1 -1
View File
@@ -470,7 +470,7 @@ export default class Client extends EventTarget {
initialResp = { command: "AUTHENTICATE", params: [respStr] }; initialResp = { command: "AUTHENTICATE", params: [respStr] };
break; break;
case "EXTERNAL": case "EXTERNAL":
initialResp = { command: "AUTHENTICATE", params: [base64.encode("")] }; initialResp = { command: "AUTHENTICATE", params: ["+"] };
break; break;
case "OAUTHBEARER": case "OAUTHBEARER":
let raw = "n,,\x01auth=Bearer " + params.token + "\x01\x01"; let raw = "n,,\x01auth=Bearer " + params.token + "\x01\x01";
+1134 -1000
View File
File diff suppressed because it is too large Load Diff