Commit graph

64 commits

Author SHA1 Message Date
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
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
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
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
3e309e9dfe Ignore RPL_AWAY 2021-11-23 17:58:49 +01:00
Simon Ser
be475026c8 lib/irc: fix handling for prefixes without host
name!user is a valid prefix.
2021-11-15 16:05:51 +01:00
Simon Ser
08cd94d775 lib/irc: add "fullname" to isMeaningfulRealname 2021-11-02 18:12:18 +01:00
Simon Ser
49a59077b7 lib/irc: extend parseURL to support flags and skip auth + options 2021-10-20 14:33:16 +02:00
Simon Ser
12440691c9 Unescape ISUPPORT values
This allows ISUPPORT values to contain spaces.

References: https://github.com/ircdocs/modern-irc/pull/137
2021-10-18 13:29:11 +02:00
Simon Ser
8bdde589bb lib/irc: "unknown" is not a meaningful realname 2021-10-15 17:44:33 +02:00
Simon Ser
a120d79585 Handle IRC URLs without channel name 2021-10-13 16:47:01 +02:00
Simon Ser
405bc51c26 Handle click on irc:// channel URLs inside buffers
References: https://todo.sr.ht/~emersion/gamja/71
2021-10-13 16:18:59 +02:00
Simon Ser
4577f0a27f components/buffer: pretty-print RPL_CHANNELMODEIS and RPL_CREATIONTIME 2021-10-06 12:12:49 +02:00
Simon Ser
19ee5553f6 components/buffer: add RPL_UMODEIS pretty-printing 2021-10-05 11:22:20 +02:00
Simon Ser
184b29b6e3 Hide meaningless real names 2021-09-21 17:24:39 +02:00
Simon Ser
329f9063d0 Add support for WHOX
This allows querying the account of the user.
2021-09-21 16:58:00 +02:00
Simon Ser
0b0467f019 lib/irc: drop CRLF for outgoing messages
Trailing CRLF must not be included in WebSocket messages.

Closes: https://todo.sr.ht/~emersion/gamja/104
2021-09-18 12:16:54 +02:00
Hubert Hirtz
f78cb8c23b Fix double space introduced before last param 2021-09-17 14:07:58 +02:00
Simon Ser
f17d61ed86 lib/irc: fix formatMessage when last arg starts with colon
Fixes: a51be5037d ("lib/irc: only add colon to trailing arg when necessary")
2021-09-08 10:42:36 +02:00
Simon Ser
a51be5037d lib/irc: only add colon to trailing arg when necessary
This mirrors go-irc's behavior:

7ba1a1858f/parser.go (L374)

Closes: https://todo.sr.ht/~emersion/gamja/103
2021-09-06 10:52:06 +02:00
Simon Ser
e283d9c7ab Add support for MONITOR 2021-08-24 12:53:46 +02:00
Simon Ser
429450e060 Handle RPL_INVITING 2021-06-24 18:01:24 +02:00
Simon Ser
bc05fd5c11 Treat server broadcasts as highlights 2021-06-23 19:52:45 +02:00
Simon Ser
0b3f5ef88b Add irc.forEachChannelModeUpdate helper 2021-06-11 12:54:42 +02:00
Simon Ser
4249da4ba8 Add /quiet and /unquiet 2021-06-11 00:27:19 +02:00
Simon Ser
8972130252 s/var/let/ 2021-06-10 18:11:11 +02:00
Simon Ser
a9c1abb064 Route channel mode and invite/except list to channel buffer 2021-06-07 14:13:00 +02:00
Simon Ser
403d7ec7f7 Add case-mapping support to irc.isHighlight
Closes: https://todo.sr.ht/~emersion/gamja/77
2021-06-06 15:52:58 +02:00
Simon Ser
0dfb7623db Add support for labeled-response
It's just used to avoid mixing up messages coming from the server
so far.
2021-06-04 20:38:01 +02:00
Simon Ser
34078d5da7 Add support for draft/event-playback 2021-06-04 19:45:51 +02:00
Simon Ser
651e255ddb Use ISUPPORT CHANTYPES in Client.isChannel 2021-06-04 19:17:39 +02:00
Simon Ser
6e20ad872e Add support for STATUSMSG
Closes: https://todo.sr.ht/~emersion/gamja/65
2021-06-03 13:31:43 +02:00
Simon Ser
283f8af4b1 lib/irc: rename IRC prefix utilities 2021-06-03 13:18:28 +02:00
Simon Ser
a4294975a2 Add support for /ban without argument 2021-06-03 10:19:09 +02:00
Drew DeVault
be1ecf607d Display prefixes in member list
Closes: https://todo.sr.ht/~emersion/gamja/43
2021-05-31 15:56:08 +02:00
Simon Ser
e080e87cb7 Pretty-print MOTD 2021-05-28 10:50:42 +02:00
Simon Ser
e9d90d4927 Fix TypeError in isHighlight
TypeError: msg.prefix is null
2021-05-28 09:49:21 +02:00
Drew DeVault
121d7ec075 Add /whois command
This also rigs up some helpers in Client for handling the whois
response, which I will use for /ban and /quiet and such shortly.
2021-05-27 23:15:53 +02:00
Simon Ser
615e746ec5 lib/client: add Client.cm
This contains the current connection case-mapping, parsed from the
CASEMAPPING ISUPPORT token.
2021-05-27 15:14:03 +02:00
Simon Ser
3110a9e2df lib/irc: add case-mapping primitives
irc.CaseMapping contains the basic canonicalization functions for
the three supported case-mappings. irc.CaseMapMap is a Map-like
class that supports case-mapped keys.
2021-05-27 15:13:32 +02:00
Simon Ser
8ab10cf2a5 lib/irc: escape/unescape everything in tags
Without the greedy flag on the regexp, String.replace will just
replace the first match.

While at it, also make sure to convert to a string when formatting
tag values. This allows tag values to be e.g. numbers.
2021-03-09 17:40:57 +01:00
Simon Ser
2d4409e7aa lib/irc: accept tags without value 2021-03-09 17:31:12 +01:00
Simon Ser
51523f4014 Extract network name from ISUPPORT 2021-01-22 11:43:47 +01:00
Simon Ser
b3f8b0c97d Add support for RPL_ISUPPORT 2021-01-22 11:34:04 +01:00
Simon Ser
0b03f9d767
Ignore RPL_TOPICWHOTIME
We don't need this piece of information yet, and we don't want to
clutter the server buffer with channel messages.
2020-09-03 11:36:08 +02:00