Commit graph

186 commits

Author SHA1 Message Date
Simon Ser
3584c1eb10 lib/irc: fix whitespace RegExp test in isURIPrefix 2024-03-13 15:41:04 +01:00
Simon Ser
2fe2ce6912 lib/irc: fix assignment to undefined variable in isURIPrefix 2024-03-07 23:04:40 +01:00
Simon Ser
57f7b1c011 lib/irc: fix whitespace split in isURIPrefix
We want to get the last index of whitespace, not the first one.
2024-03-07 11:40:37 +01:00
Simon Ser
5d3738bc40 lib/irc: ignore highlights in URLs 2024-03-02 12:36:30 +01:00
Simon Ser
429b4595e7 lib/client: print raw messages in debug mode
Browser consoles aren't super helpful in general and just show
the command name, require extra clicks to see the params.
2024-03-01 15:03:09 +01:00
Simon Ser
b38777e92a lib/linkify: add geo URI scheme 2024-01-10 11:38:23 +01:00
Simon Ser
0640ff8712 Upgrade linkifyjs to v4 2024-01-10 11:33:20 +01:00
Simon Ser
8f29f0c35d lib/client: ensure server prefix is never null
Fixes a null deref in handleChatMessage, because incoming message
prefixes are populated with the server's if null.
2023-08-17 10:45:56 +02:00
Simon Ser
535bdb2f52 Migrate to async/await 2023-04-19 12:51:13 +02:00
Simon Ser
57f64e9cc2 lib/irc: add formatURL 2023-04-19 11:43:45 +02:00
Simon Ser
fd63c169ed lib/client: encode empty SASL response as "+" 2023-03-21 17:57:09 +01:00
delthas
081f5743be Fix stripping hex color formatting
Hex colors can be set with the same formats as the regular colors:
<CODE>, <CODE><COLOR>, or <CODE><COLOR>,<COLOR>.

Previously we only supporteed <CODE><COLOR>.

This patch enables stripping colors for all valid color formats.

Co-authored-by: Simon Ser <contact@emersion.fr>
2022-12-02 16:03:14 +01:00
Simon Ser
4b306305bf Move msg.tags fallback to client 2022-11-30 11:30:46 +01:00
Simon Ser
dc5e64aaac lib/client: unify checks for chathistory end 2022-11-30 10:17:50 +01:00
Simon Ser
2d27168529 Use ratified extended-monitor cap name
References: https://github.com/ircv3/ircv3-specifications/pull/508
2022-11-06 20:40:00 +01:00
Simon Ser
e815295503 Add support for OAuth 2.0 authentication 2022-10-14 10:52:44 +02:00
Simon Ser
a2d2a11d44 Drop support for soju.im/read
It's been superseded by draft/read-marker.
2022-09-03 14:41:53 +02:00
Simon Ser
e6618c8a1f Fix draft/read-marker cap not negotiated
Fixes: 1428ec4d49 ("Add support for draft/read-marker")
2022-09-03 14:40:54 +02:00
Simon Ser
4780b9c709 Fetch read marker before backlog for user targets 2022-09-03 14:31:56 +02:00
Simon Ser
e7b69cec9a Limit composer length
Often times IRC servers will truncate messages which are too big.
2022-08-28 19:16:41 +02:00
Simon Ser
7138e43710 Ignore RPL_CHANNEL_URL 2022-08-22 10:35:50 +02:00
Simon Ser
1428ec4d49 Add support for draft/read-marker
References: https://github.com/ircv3/ircv3-specifications/pull/489
2022-07-01 13:35:27 +02:00
Simon Ser
505a6fd5ab Workaround the sad state of base64 web APIs
This is necessary to make usernames/passwords with UTF-8 in them
work correctly.
2022-06-24 23:59:18 +02:00
Simon Ser
baaf576d82 Add a settings dialog
Add an option to hide chat events or always expand them.

Closes: https://todo.sr.ht/~emersion/gamja/73
2022-06-08 16:57:16 +02:00
Simon Ser
6b04cb1417 Add support for bot mode
References: https://ircv3.net/specs/extensions/bot-mode
2022-06-08 15:04:27 +02:00
Simon Ser
4a981997f0 Handle CHATHISTORY messages when reaching end of batch
Closes: https://todo.sr.ht/~emersion/gamja/115
2022-04-22 11:25:41 +02:00
Simon Ser
e37d5f363b lib/irc: fix bound check in isHighlight
Doesn't seem like this was causing any issues, but let's fix the
logic regardless.
2022-02-25 11:38:00 +01:00
Simon Ser
221b1b6356 lib/irc: remove unnecessary non-breaking-space case
Handled by the default case already.
2022-02-25 11:37:18 +01:00
Simon Ser
86b1030b7a lib/irc: add missing num range to alphaNum regexp 2022-02-25 11:36:43 +01:00
Simon Ser
9e703698ca lib/irc: drop outdated CapRegistry TODO 2022-02-16 15:46:22 +01:00
Simon Ser
db0ef39c6b Add support for soju.im/read 2022-02-11 19:32:26 +01:00
Дамјан Георгиевски
1142145c6d fix ping after reconnect
client.setPingInterval was only called once in app.connect(),
but client.disconnect() disables it, and the ping timer is never again set,
even though the client can reconnect.

the change passes the ping time as a parameter to the client, and the
client calls setPingInterval() after a successful WS open event.
2022-02-04 15:54:23 +01:00
delthas
fab42ba2ee commands: add password param to /join 2022-02-02 20:45:18 +01:00
Simon Ser
bd48f36ade lib/irc: add missing Isupport.chanModes
It was called by forEachChannelModeUpdate, but wasn't implemented.
2022-01-31 18:24:34 +01:00
Simon Ser
4cabae89ff lib/irc: add CapRegistry 2021-12-10 15:34:51 +01:00
Simon Ser
f81c564d23 Implement exponential backoff for reconnections
Closes: https://todo.sr.ht/~emersion/gamja/118
2021-12-07 13:05:42 +01:00
Simon Ser
ab3d4dd661 Refactor ISUPPORT handling
Add a helper class to parse ISUPPORT tokens. Instead of having
manual ISUPPORT handling all over the place, use pre-processed
values.
2021-12-07 12:09:10 +01:00
Simon Ser
31b293fa03 lib/client: use Error objects for error events 2021-12-06 23:09:30 +01:00
Simon Ser
f9ec578fce Handle FAIL ACCOUNT_REQUIRED 2021-12-06 22:54:15 +01:00
Simon Ser
305f510501 Read nickname from RPL_WELCOME
References: https://github.com/ircdocs/modern-irc/pull/146
2021-12-06 17:55:47 +01:00
Simon Ser
05f7c6e9fe Add Client.join, show join errors in popup 2021-12-04 17:44:23 +01:00
Simon Ser
fc8aa30756 lib/client: add generic error handling to roundtrip() 2021-12-04 17:22:36 +01:00
Simon Ser
8c8bd43638 lib/client: introduce IRCError 2021-12-04 17:05:34 +01:00
Simon Ser
93ba0e6443 Disable debug logs in production
console.debug logs cause some performance issues because the browser
is forced to save the logged objects just in case the user opens the
debugging tools.

They can be force-enabled back by adding ?debug=1 to the URL.

Only console.debug is disabled, console.log and other levels are a lot
less verbose and still enabled by default.
2021-12-01 11:40:59 +01:00
Simon Ser
be08302c1f Add support for draft/account-registration
A new UI to register and verify accounts is added.
2021-11-30 14:59:44 +01:00
Simon Ser
3e309e9dfe Ignore RPL_AWAY 2021-11-23 17:58:49 +01:00
Simon Ser
24b50a332c lib/client: make authenticate() return a promise
This lets the caller handle the success/failure.
2021-11-21 16:06:13 +01:00
Simon Ser
adefc620de lib/client: send BOUNCER BIND and CAP END immediately
Don't wait for auth to finish. This reduces the number of roundtrips.
2021-11-21 13:48:41 +01:00
Simon Ser
bc3abbec32 lib/client: catch handleMessage errors 2021-11-21 13:48:07 +01:00
Simon Ser
4f927b5536 lib/client: always request sasl cap when available
This will allow us to issue post-registration SASL commands.
2021-11-21 13:35:32 +01:00