summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/channels.cpp6
-rw-r--r--src/coremods/core_channel/cmode_k.cpp5
-rw-r--r--src/coremods/core_channel/core_channel.h1
3 files changed, 9 insertions, 3 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index e5fd7265e..760b5c4bd 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -436,7 +436,7 @@ void Channel::Write(ClientProtocol::Event& protoev, char status, const CUList& e
}
}
-const char* Channel::ChanModes(bool showkey)
+const char* Channel::ChanModes(bool showsecret)
{
static std::string scratch;
std::string sparam;
@@ -455,9 +455,9 @@ const char* Channel::ChanModes(bool showkey)
if (!pm)
continue;
- if (n == 'k' - 65 && !showkey)
+ if (pm->IsParameterSecret() && !showsecret)
{
- sparam += " <key>";
+ sparam += " <" + pm->name + ">";
}
else
{
diff --git a/src/coremods/core_channel/cmode_k.cpp b/src/coremods/core_channel/cmode_k.cpp
index 4fc29e04c..acb6813be 100644
--- a/src/coremods/core_channel/cmode_k.cpp
+++ b/src/coremods/core_channel/cmode_k.cpp
@@ -87,3 +87,8 @@ ModeAction ModeChannelKey::OnSet(User* source, Channel* chan, std::string& param
// Dummy function, never called
return MODEACTION_DENY;
}
+
+bool ModeChannelKey::IsParameterSecret()
+{
+ return true;
+} \ No newline at end of file
diff --git a/src/coremods/core_channel/core_channel.h b/src/coremods/core_channel/core_channel.h
index 6e11275df..096db8c0d 100644
--- a/src/coremods/core_channel/core_channel.h
+++ b/src/coremods/core_channel/core_channel.h
@@ -179,6 +179,7 @@ class ModeChannelKey : public ParamMode<ModeChannelKey, LocalStringExt>
ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string& parameter, bool adding) CXX11_OVERRIDE;
void SerializeParam(Channel* chan, const std::string* key, std::string& out) ;
ModeAction OnSet(User* source, Channel* chan, std::string& param) CXX11_OVERRIDE;
+ bool IsParameterSecret() CXX11_OVERRIDE;
};
/** Channel mode +l