aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Sadie Powell2024-11-07 22:28:40 +0000
committerGravatar Sadie Powell2024-11-07 22:32:13 +0000
commit87145f5790f5f135517ab30cadbc6a56e0a531b8 (patch)
treecdd4665c54b5b3204d03fabd8f0dd0b946e2d3fe /src
parentUpdate irctest. (diff)
Backport support for the IRCv3 websocket subprotocols.
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_websocket.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/modules/m_websocket.cpp b/src/modules/m_websocket.cpp
index a88af2df5..81c22382b 100644
--- a/src/modules/m_websocket.cpp
+++ b/src/modules/m_websocket.cpp
@@ -450,8 +450,11 @@ class WebSocketHook : public IOHookMiddle
{
proto.erase(std::remove_if(proto.begin(), proto.end(), ::isspace), proto.end());
- bool is_binary = stdalgo::string::equalsci(proto, "binary.inspircd.org");
- bool is_text = stdalgo::string::equalsci(proto, "text.inspircd.org");
+ bool is_binary = (sock->type == StreamSocket::SS_USER && stdalgo::string::equalsci(proto, "binary.ircv3.net"))
+ || stdalgo::string::equalsci(proto, "binary.inspircd.org");
+
+ bool is_text = (sock->type == StreamSocket::SS_USER && stdalgo::string::equalsci(proto, "text.ircv3.net"))
+ || stdalgo::string::equalsci(proto, "text.inspircd.org");
if (is_binary || is_text)
{