summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2020-07-27 09:51:34 +0100
committerSadie Powell <sadie@witchery.services>2020-07-27 09:51:34 +0100
commit1047f053811717df4e4c3c18c512b169b64aa93a (patch)
treeb76405a1a8e1b2c96c8230dff4c15c676a084682 /src
parent30648e84ce9c2515994b95b9d1e2e870283ed214 (diff)
Send ERR_KEYSET when trying to change a channel key.
Closes #1750.
Diffstat (limited to 'src')
-rw-r--r--src/coremods/core_channel/cmode_k.cpp1
-rw-r--r--src/coremods/core_channel/core_channel.h3
2 files changed, 3 insertions, 1 deletions
diff --git a/src/coremods/core_channel/cmode_k.cpp b/src/coremods/core_channel/cmode_k.cpp
index ea4b5241d..495af3650 100644
--- a/src/coremods/core_channel/cmode_k.cpp
+++ b/src/coremods/core_channel/cmode_k.cpp
@@ -46,6 +46,7 @@ ModeAction ModeChannelKey::OnModeChange(User* source, User*, Channel* channel, s
if (exists && (parameter != *key))
{
/* Key is currently set and the correct key wasn't given */
+ source->WriteNumeric(ERR_KEYSET, channel->name, "Channel key already set");
return MODEACTION_DENY;
}
} else {
diff --git a/src/coremods/core_channel/core_channel.h b/src/coremods/core_channel/core_channel.h
index 3701b9a71..26b23c3ea 100644
--- a/src/coremods/core_channel/core_channel.h
+++ b/src/coremods/core_channel/core_channel.h
@@ -54,7 +54,8 @@ enum
{
// From RFC 1459.
RPL_BANLIST = 367,
- RPL_ENDOFBANLIST = 368
+ RPL_ENDOFBANLIST = 368,
+ ERR_KEYSET = 467
};
/** Handle /INVITE.