- Srv->SendTo(NULL,user,"NOTICE "+std::string(user->nick)+" :*** The user "+target->nick+" is not on channel "+channel->name);
- return;
- }
-
- /* And see if the person calling the command has access to use it on the channel */
- uprivs = Srv->ChanMode(user, channel);
-
- /* Check what privs the person being removed has */
- tprivs = Srv->ChanMode(target, channel);
-
- if(pcnt > 2)
- reason = "Removed by " + std::string(user->nick) + ":";
+ 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));
+ }
+
+ /* Now it's the same idea, except for the target. If they're ulined make sure they get a higher level than the sender can */
+ if (ServerInstance->ULine(target->server) || ServerInstance->ULine(target->nick.c_str()))
+ {
+ tlevel = chartolevel("U");
+ }
+ else if (target->GetExt(founderkey))
+ {
+ tlevel = chartolevel("~");
+ }
+ else if (target->GetExt(protectkey))
+ {
+ tlevel = chartolevel("&");
+ }