Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/zncPublic

Allow ISUPPORT parameters to be negated#1789

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
kylef wants to merge1 commit intoznc:master
base:master
Choose a base branch
Loading
fromkylef:support-removal
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Allow ISUPPORT parameters to be negated
ISUPPORT allows negating parameters via `-PARAMETER` which allowsservers to change functionality without disconnecting clients.
  • Loading branch information
@kylef
kylef committedJun 1, 2021
commitac26acd24f92ad046ab2ca0f6a399fb0f61f5e5f
10 changes: 9 additions & 1 deletionsrc/IRCSock.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1358,7 +1358,11 @@ void CIRCSock::ParseISupport(const CMessage& Message) {
break;
}

m_mISupport[sName] = sValue;
if (sName.StartsWith("-")) {
m_mISupport.erase(sName.TrimPrefix_n("-"));
} else {
m_mISupport[sName] = sValue;
}

if (sName.Equals("PREFIX")) {
CString sPrefixes = sValue.Token(1, false, ")");
Expand DownExpand Up@@ -1393,10 +1397,14 @@ void CIRCSock::ParseISupport(const CMessage& Message) {
if (m_bNamesx) continue;
m_bNamesx = true;
PutIRC("PROTOCTL NAMESX");
} else if (sName.Equals("-NAMESX")) {
m_bNamesx = false;
} else if (sName.Equals("UHNAMES")) {
if (m_bUHNames) continue;
m_bUHNames = true;
PutIRC("PROTOCTL UHNAMES");
} else if (sName.Equals("-UHNAMES")) {
m_bUHNames = false;
}
}
}
Expand Down
28 changes: 28 additions & 0 deletionstest/ClientTest.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -153,6 +153,20 @@ TEST_F(ClientTest, MultiPrefixNames) { // aka NAMESX
ElementsAre(msg.ToString(), extmsg.ToString()));
}

TEST_F(ClientTest, MultiPrefixNamesDisabled) {
m_pTestSock->ReadLine(
":server 005 guest NAMESX :are supported by this server");

EXPECT_TRUE(m_pTestSock->HasNamesx());
EXPECT_EQ(m_pTestSock->GetISupport("NAMESX", "unset"), "");

m_pTestSock->ReadLine(
":server 005 guest -NAMESX :are supported by this server");

EXPECT_FALSE(m_pTestSock->HasNamesx());
EXPECT_EQ(m_pTestSock->GetISupport("NAMESX", "unset"), "unset");
}

TEST_F(ClientTest, UserhostInNames) { // aka UHNAMES
m_pTestSock->ReadLine(
":server 005 guest UHNAMES :are supported by this server");
Expand All@@ -172,6 +186,20 @@ TEST_F(ClientTest, UserhostInNames) { // aka UHNAMES
ElementsAre(msg.ToString(), extmsg.ToString()));
}

TEST_F(ClientTest, UserhostInNamesDisabled) {
m_pTestSock->ReadLine(
":server 005 guest UHNAMES :are supported by this server");

EXPECT_TRUE(m_pTestSock->HasUHNames());
EXPECT_EQ(m_pTestSock->GetISupport("UHNAMES", "unset"), "");

m_pTestSock->ReadLine(
":server 005 guest -UHNAMES :are supported by this server");

EXPECT_FALSE(m_pTestSock->HasUHNames());
EXPECT_EQ(m_pTestSock->GetISupport("UHNAMES", "unset"), "unset");
}

TEST_F(ClientTest, ExtendedJoin) {
m_pTestSock->ReadLine(":server CAP * ACK :extended-join");
m_pTestClient->Reset();
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp