+ /* 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))
+ {
+ tlevel = chartolevel("U");
+ }
+ else if (target->GetExt(founderkey))
+ {
+ tlevel = chartolevel("~");
+ }
+ else if (target->GetExt(protectkey))
+ {
+ tlevel = chartolevel("&");
+ }
+ else
+ {
+ tlevel = chartolevel(channel->GetPrefixChar(target));
+ }
+
+ hasnokicks = (ServerInstance->FindModule("m_nokicks.so") && channel->IsModeSet('Q'));
+
+ /* We support the +Q channel mode via. the m_nokicks module, if the module is loaded and the mode is set then disallow the /remove */
+ if ((!IS_LOCAL(user)) || (!supportnokicks || !hasnokicks || (ulevel == ULINE)))
+ {
+ /* We'll let everyone remove their level and below, eg:
+ * ops can remove ops, halfops, voices, and those with no mode (no moders actually are set to 1)
+ * a ulined target will get a higher level than it's possible for a /remover to get..so they're safe.
+ * Nobody may remove a founder.
+ */
+ if ((!IS_LOCAL(user)) || ((ulevel > PEON) && (ulevel >= tlevel) && (tlevel != OWNER)))