+ User* target;
+ Channel* channel;
+ std::string reason;
+
+ /* 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 ...]
+ * /fpart <channel> <nick> [reason ...]
+ */
+ const std::string& channame = parameters[neworder ? 0 : 1];
+ const std::string& username = parameters[neworder ? 1 : 0];
+
+ /* Look up the user we're meant to be removing from the channel */
+ target = ServerInstance->FindNick(username);
+
+ /* And the channel we're meant to be removing them from */
+ channel = ServerInstance->FindChan(channame);
+
+ /* Fix by brain - someone needs to learn to validate their input! */
+ if ((!target) || (target->registered != REG_ALL) || (!channel))
+ {
+ user->WriteNumeric(ERR_NOSUCHNICK, "%s %s :No such nick/channel", user->nick.c_str(), !channel ? channame.c_str() : username.c_str());
+ return CMD_FAILURE;
+ }
+
+ if (!channel->HasUser(target))
+ {
+ user->WriteServ( "NOTICE %s :*** The user %s is not on channel %s", user->nick.c_str(), target->nick.c_str(), channel->name.c_str());
+ return CMD_FAILURE;
+ }
+
+ int ulevel = channel->GetPrefixValue(user);
+ int tlevel = channel->GetPrefixValue(target);
+
+ if (ServerInstance->ULine(target->server))