Commit graph

70 commits

Author SHA1 Message Date
Simon Ser
57f64e9cc2 lib/irc: add formatURL 2023-04-19 11:43:45 +02:00
Simon Ser
90a2c91651 Load initial members state via WHO when channel is selected
Closes: https://todo.sr.ht/~emersion/gamja/13
2022-10-23 20:18:33 +02:00
Nolan Prescott
096fcbf829 Sort lists with localeCompare
The difference in case sensitivity is the most obvious change with
servers like soju that support CASEMAPPING ascii and
rfc1459. Currently the list:
  'Alpha', 'aardvark', 'Charlie', 'comma'
currently sorts to:
  'Alpha', 'Charlie', 'aardvark', 'comma'
with this change it will instead become:
  'aardvark', 'Alpha', 'Charlie', 'comma'

If something like RFC 7613 gets broader support then there are a few
more differences for a list like:
  'éclair', 'ecstatic, 'aardvark', 'zed', 'Gamma'
currently sorts to:
  'Gamma', 'aardvark', 'ecstatic', 'zed', 'éclair'
with this patch would instead sort to:
  'aardvark', 'éclair', 'ecstatic', 'Gamma', 'zed'

The above examples were run with a locale unspecified which fell back
to my browser/host default of 'en'.
2022-09-05 09:03:42 +02:00
Simon Ser
54453c5f44 Fix invalid relative import
Worked locally because it's served at the root…
2022-06-27 17:16:33 +02:00
Simon Ser
7cabb6f85b Add a setting for seconds in timestamps 2022-06-27 16:34:41 +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
2ac7be6218 state: add isReceiptBefore 2022-02-12 10:21:11 +01:00
Simon Ser
5f8cd976e6 keybindings: fix error on alt+h
Fixes the following JS error:

    TypeError: e.setReceipt is not a function
2022-02-12 10:05:58 +01:00
Simon Ser
d2bcea8c86 Introduce isMessageBeforeReceipt 2022-02-11 16:37:58 +01:00
Simon Ser
e1bbe34ff2 state: add bouncerNetworks helpers 2022-02-04 14:22:50 +01:00
Simon Ser
b11f58b975 state: fix prefix() call in MODE handler
Lost during a refactoring.

Fixes: ab3d4dd661 ("Refactor ISUPPORT handling")
2021-12-16 23:37:33 +01:00
Simon Ser
4cabae89ff lib/irc: add CapRegistry 2021-12-10 15:34:51 +01:00
Simon Ser
fc93a8cef5 state: fix server bouncerNetID
Ooops.
2021-12-07 13:37:14 +01:00
Simon Ser
f3d38859d3 Move isBouncer props to server state
Avoids having to pass this around.
2021-12-07 13:16:07 +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
30e3ec392f Update channel join status when kicked 2021-12-04 16:52:38 +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
3e2ac307f6 Add post-connect UI to login via SASL
If the server supports SASL and if we aren't logged in with any
account, add a UI to authenticate via SASL. This allows users to
login anonymously then login via SASL.

This will also ease the draft/account-registration implementation.
2021-11-21 16:40:46 +01:00
Simon Ser
0af40a1a8e state: add account to server 2021-11-21 12:13:44 +01:00
Simon Ser
55361c5a2b Store WHO list in RPL_ENDOFWHO
This allows the state-tracker to figure out whether a WHO query
returned no result.
2021-11-10 10:32:23 +01:00
Simon Ser
df29650b98 Always insert non-chathistory messages at the end 2021-11-09 10:49:18 +01:00
Simon Ser
800f5ceb6a Keep track of channel join status
This makes us behave better when we receive a self-PART message
from the server.
2021-11-05 11:49:56 +01:00
Simon Ser
483f0c65b1 Add hint in server operators buffer header 2021-11-01 18:45:16 +01:00
Simon Ser
a1057092e0 state: move in QUIT and NICK update logic 2021-10-23 23:24:11 +02:00
Simon Ser
c4a1f38b33 state: process RPL_NAMREPLY atomically
This allows updating the buf.members map only once when receiving
RPL_ENDOFNAMES, instead of repeatedly re-creating it each time a
RPL_NAMREPLY message is received.
2021-10-23 20:05:07 +02:00
Simon Ser
d9f36c82ba Allow bouncers to set NETWORK in ISUPPORT
This allows bouncers to customize the name they appear with.
2021-10-18 19:51:30 +02:00
Simon Ser
a31976586c Fallback to bouncer network host if name is unset 2021-10-15 18:23:56 +02:00
Simon Ser
bfef13824e Use ISUPPORT NETWORK if user hasn't specified custom name 2021-10-15 14:05:39 +02:00
Simon Ser
a9cfbcd6b6 Fix duplicate declaration in State.handleMessage 2021-09-21 17:24:13 +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
d12e1109b3 Add support for account-notify 2021-09-21 14:49:32 +02:00
Simon Ser
11878aaaa9 Add support for extended-join 2021-09-21 14:29:31 +02:00
Simon Ser
3746095175 Update user username/hostname on JOIN 2021-09-21 14:12:07 +02:00
Simon Ser
ecb2ee041b Update user on QUIT and NICK 2021-09-21 14:00:52 +02:00
Simon Ser
c66ce61029 Introduce per-server user map
This allows us to store information about users in a signle place,
instead of putting it in user buffers. This is required to display
metadata about users in the channel members list.
2021-09-21 13:33:15 +02:00
Simon Ser
e7f8620933 Add State.create() 2021-09-21 12:33:22 +02:00
Simon Ser
0137a95268 Add support for chghost
See https://ircv3.net/specs/extensions/chghost
2021-09-06 11:20:33 +02:00
Simon Ser
8a5e52ed9a Rename buffer lastReadReceipt to prevReadReceipt
This field is intentionally behind the latest read receipt. Let's
rename it to make that clearer.
2021-08-24 14:01:57 +02:00
Simon Ser
6e59a77672 Don't drop unread marker in addMessage
Closes: https://todo.sr.ht/~emersion/gamja/76
2021-08-24 13:59:33 +02:00
Simon Ser
e283d9c7ab Add support for MONITOR 2021-08-24 12:53:46 +02:00
Simon Ser
0b3f5ef88b Add irc.forEachChannelModeUpdate helper 2021-06-11 12:54:42 +02:00
Simon Ser
37cff435a3 Move MODE state updates outof App 2021-06-11 12:44:14 +02:00
Simon Ser
d19f127952 Move message key generation to State.addMessage 2021-06-11 10:58:09 +02:00
Simon Ser
8972130252 s/var/let/ 2021-06-10 18:11:11 +02:00
Simon Ser
bf76eaa669 Add State.createServer 2021-06-10 10:54:33 +02:00
Simon Ser
5fcbfa446c Use server buffer if name is unspecified in State.getBuffer 2021-06-10 09:25:17 +02:00
Simon Ser
34078d5da7 Add support for draft/event-playback 2021-06-04 19:45:51 +02:00
Simon Ser
87588abf27 Add State.addMessage 2021-06-04 19:07:14 +02:00
Simon Ser
04362644bf Handle TOPIC in State.handleMessage 2021-06-04 18:57:02 +02:00