Skip to content

Commit

Permalink
Advertise ISUPPORT soju.im/SAFERATE
Browse files Browse the repository at this point in the history
  • Loading branch information
progval committed Oct 21, 2024
1 parent 7fcc45b commit 05c04e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions lib/irc/handler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,11 @@ defmodule M51.IrcConn.Handler do
"UTF8ONLY",
"are supported by this server"
])
send_numeric.("005", [
# https://codeberg.org/emersion/soju/src/branch/master/doc/ext/saferate.md
"soju.im/SAFERATE",
"are supported by this server"
])

# RPL_MOTDSTART
send_numeric.("375", ["- Message of the day"])
Expand Down
6 changes: 4 additions & 2 deletions test/irc/handler_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ defmodule M51.IrcConn.HandlerTest do

@cap_ls_302 ":server. CAP * LS :account-tag batch draft/account-registration=before-connect draft/channel-rename draft/chathistory draft/message-redaction draft/multiline=max-bytes=8192 draft/no-implicit-names draft/sasl-ir echo-message extended-join labeled-response message-tags sasl=PLAIN server-time soju.im/account-required standard-replies userhost-in-names\r\n"
@cap_ls ":server. CAP * LS :account-tag batch draft/account-registration draft/channel-rename draft/chathistory draft/message-redaction draft/multiline draft/no-implicit-names draft/sasl-ir echo-message extended-join labeled-response message-tags sasl server-time soju.im/account-required standard-replies userhost-in-names\r\n"
@isupport "CASEMAPPING=rfc3454 CLIENTTAGDENY=*,-draft/react,-draft/reply CHANLIMIT= CHANMODES=b,,,i CHANTYPES=#! CHATHISTORY=100 LINELEN=8192 MAXTARGETS=1 MSGREFTYPES=msgid PREFIX= TARGMAX=JOIN:1,PART:1 UTF8ONLY :are supported by this server\r\n"
@isupport1 "CASEMAPPING=rfc3454 CLIENTTAGDENY=*,-draft/react,-draft/reply CHANLIMIT= CHANMODES=b,,,i CHANTYPES=#! CHATHISTORY=100 LINELEN=8192 MAXTARGETS=1 MSGREFTYPES=msgid PREFIX= TARGMAX=JOIN:1,PART:1 UTF8ONLY :are supported by this server\r\n"
@isupport2 "soju.im/SAFERATE :are supported by this server\r\n"

setup do
start_supervised!({MockMatrixClient, {self()}})
Expand Down Expand Up @@ -66,7 +67,8 @@ defmodule M51.IrcConn.HandlerTest do

def assert_welcome(nick) do
assert_line(":server. 001 #{nick} :Welcome to this Matrix bouncer.\r\n")
assert_line(":server. 005 #{nick} #{@isupport}")
assert_line(":server. 005 #{nick} #{@isupport1}")
assert_line(":server. 005 #{nick} #{@isupport2}")
assert_line(":server. 375 #{nick} :- Message of the day\r\n")
assert_line(":server. 372 #{nick} :Welcome to Matrix2051, a Matrix bouncer.\r\n")
assert_line(":server. 372 #{nick} :\r\n")
Expand Down

0 comments on commit 05c04e9

Please sign in to comment.