summaryrefslogtreecommitdiff
path: root/src/modules/m_namedmodes.cpp
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2016-03-22 16:44:45 +0100
committerAttila Molnar <attilamolnar@hush.com>2016-03-22 16:44:45 +0100
commit0de5aa7c5cfff6d2389f1adcc41d6b2deeec2bc4 (patch)
treeaf6bc24efec1bba1ab2244855aa8a2db83623026 /src/modules/m_namedmodes.cpp
parent3aa92b8d13f57b228d565df23cdad4c720d5cff0 (diff)
m_namedmodes Inherit command handler from SplitCommand
Pass a LocalUser pointer to DisplayList()
Diffstat (limited to 'src/modules/m_namedmodes.cpp')
-rw-r--r--src/modules/m_namedmodes.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/modules/m_namedmodes.cpp b/src/modules/m_namedmodes.cpp
index 10bef981a..9c7b24666 100644
--- a/src/modules/m_namedmodes.cpp
+++ b/src/modules/m_namedmodes.cpp
@@ -19,7 +19,7 @@
#include "inspircd.h"
-static void DisplayList(User* user, Channel* channel)
+static void DisplayList(LocalUser* user, Channel* channel)
{
std::stringstream items;
const ModeParser::ModeHandlerMap& mhs = ServerInstance->Modes->GetModes(MODETYPE_CHANNEL);
@@ -42,15 +42,16 @@ static void DisplayList(User* user, Channel* channel)
user->WriteNumeric(960, channel->name, "End of mode list");
}
-class CommandProp : public Command
+class CommandProp : public SplitCommand
{
public:
- CommandProp(Module* parent) : Command(parent, "PROP", 1)
+ CommandProp(Module* parent)
+ : SplitCommand(parent, "PROP", 1)
{
syntax = "<user|channel> {[+-]<mode> [<value>]}*";
}
- CmdResult Handle(const std::vector<std::string> &parameters, User *src)
+ CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* src)
{
Channel* const chan = ServerInstance->FindChan(parameters[0]);
if (!chan)
@@ -103,7 +104,8 @@ class DummyZ : public ModeHandler
// Handle /MODE #chan Z
void DisplayList(User* user, Channel* chan)
{
- ::DisplayList(user, chan);
+ if (IS_LOCAL(user))
+ ::DisplayList(static_cast<LocalUser*>(user), chan);
}
};