diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-06-09 17:43:50 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-06-09 17:43:50 +0200 |
commit | f45a8e2a14329860ad07b903797cef00a925e8cb (patch) | |
tree | e95629a950190ff15f9f52c32168b029e9d7e127 | |
parent | f5079e6b2ab7551517132978185191154b92dacb (diff) |
m_remove Recognize /REMOVE <chan> <nick>
The old syntax is now deprecated
Fixes issue #860 reported by @Shawn-Smith
-rw-r--r-- | docs/conf/helpop-full.conf.example | 8 | ||||
-rw-r--r-- | src/modules/m_remove.cpp | 7 |
2 files changed, 8 insertions, 7 deletions
diff --git a/docs/conf/helpop-full.conf.example b/docs/conf/helpop-full.conf.example index 3374dea34..bd959f0d2 100644 --- a/docs/conf/helpop-full.conf.example +++ b/docs/conf/helpop-full.conf.example @@ -91,7 +91,7 @@ and S queries the status."> Authenticate for a vhost using the specified username and password."> -<helpop key="remove" value="/REMOVE [nick] [channel] {[reason]} +<helpop key="remove" value="/REMOVE [channel] [nick] {[reason]} Removes a user from a channel you specify. You must be at least a channel halfoperator to remove a user. A removed user will part with @@ -104,10 +104,8 @@ E.g. /RMODE #Chan b m:* will remove all mute extbans."> <helpop key="fpart" value="/FPART [channel] [nick] {[reason]} -This behaves identically to /REMOVE, the only difference is that the -[channel] and [nick] parameters are switched around to match /KICK's -syntax. Also, /REMOVE is a builtin mIRC command which caused trouble -for some users."> +This behaves identically to /REMOVE. /REMOVE is a builtin mIRC command +which caused trouble for some users."> <helpop key="devoice" value="/DEVOICE [channel] diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp index 2530f3ef1..1b7d84de2 100644 --- a/src/modules/m_remove.cpp +++ b/src/modules/m_remove.cpp @@ -45,12 +45,15 @@ class RemoveBase : public Command { } - CmdResult HandleRMB(const std::vector<std::string>& parameters, User *user, bool neworder) + CmdResult HandleRMB(const std::vector<std::string>& parameters, User *user, bool fpart) { User* target; Channel* channel; std::string reason; + // If the command is a /REMOVE then detect the parameter order + bool neworder = ((fpart) || (parameters[0][0] == '#')); + /* Set these to the parameters needed, the new version of this module switches it's parameters around * supplying a new command with the new order while keeping the old /remove with the older order. * /remove <nick> <channel> [reason ...] @@ -156,7 +159,7 @@ class CommandRemove : public RemoveBase CommandRemove(Module* Creator, bool& snk, ChanModeReference& nkm) : RemoveBase(Creator, snk, nkm, "REMOVE") { - syntax = "<nick> <channel> [<reason>]"; + syntax = "<channel> <nick> [<reason>]"; TRANSLATE3(TR_NICK, TR_TEXT, TR_TEXT); } |