- WriteServ(user->fd,"401 %s %s :No such nick/channel",user->nick, !target ? parameters[0] : parameters[1]);
- return;
+ user->WriteNumeric(ERR_NOSUCHNICK, "%s %s :No such nick/channel", user->nick.c_str(), !target ? username : channame);
+ 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;
+ }
+
+ /* This is adding support for the +q and +a channel modes, basically if they are enabled, and the remover has them set.
+ * Then we change the @|%|+ to & if they are +a, or ~ if they are +q */
+ protectkey = "cm_protect_" + std::string(channel->name);
+ founderkey = "cm_founder_" + std::string(channel->name);
+
+ if (ServerInstance->ULine(user->server) || ServerInstance->ULine(user->nick.c_str()))
+ {
+ ulevel = chartolevel("U");
+ }
+ if (user->GetExt(founderkey))
+ {
+ ulevel = chartolevel("~");
+ }
+ else if (user->GetExt(protectkey))
+ {
+ ulevel = chartolevel("&");
+ }
+ else
+ {
+ ulevel = chartolevel(channel->GetPrefixChar(user));