- /* 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 */
- if (user->GetExt("cm_protect_"+std::string(channel->name)))
- privs = std::string("&");
- if (user->GetExt("cm_founder_"+std::string(channel->name)))
- privs = std::string("~");
-
- /* Now it's the same idea, except for the target */
- if (target->GetExt("cm_protect_"+std::string(channel->name)))
- targetprivs = std::string("&");
- if (target->GetExt("cm_founder_"+std::string(channel->name)))
- targetprivs = std::string("~");
+ /* 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 (Srv->IsUlined(user->server) || Srv->IsUlined(user->nick))
+ {
+ log(DEBUG, "Setting ulevel to U");
+ ulevel = chartolevel("U");
+ }
+ if (user->GetExt(founderkey))
+ {
+ log(DEBUG, "Setting ulevel to ~");
+ ulevel = chartolevel("~");
+ }
+ else if (user->GetExt(protectkey))
+ {
+ log(DEBUG, "Setting ulevel to &");
+ ulevel = chartolevel("&");
+ }
+ else
+ {
+ log(DEBUG, "Setting ulevel to %s", channel->GetStatusChar(user));
+ ulevel = chartolevel(channel->GetStatusChar(user));
+ }