From 05c04e9cf7babe9cdb82931cbf128e2d1229da52 Mon Sep 17 00:00:00 2001 From: Val Lorentz Date: Mon, 21 Oct 2024 23:45:19 +0200 Subject: [PATCH] Advertise ISUPPORT soju.im/SAFERATE --- lib/irc/handler.ex | 5 +++++ test/irc/handler_test.exs | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/irc/handler.ex b/lib/irc/handler.ex index d1aadbc..edbc5dc 100644 --- a/lib/irc/handler.ex +++ b/lib/irc/handler.ex @@ -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"]) diff --git a/test/irc/handler_test.exs b/test/irc/handler_test.exs index 4c33d21..7fdb68a 100644 --- a/test/irc/handler_test.exs +++ b/test/irc/handler_test.exs @@ -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()}}) @@ -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")