+ /* 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)))
+ {
+ // no you can't just go from a std::ostringstream to a std::string, Om. -nenolod
+ // but you can do this, nenolod -brain
+
+ std::string reasonparam("No reason given");
+
+ /* If a reason is given, use it */
+ if(pcnt > 2)
+ {
+ /* Join params 2 ... pcnt - 1 (inclusive) into one */
+ irc::stringjoiner reason_join(" ", parameters, 2, pcnt - 1);
+ reasonparam = reason_join.GetJoined();
+ }
+
+ /* Build up the part reason string. */
+ reason = std::string("Removed by ") + user->nick + ": " + reasonparam;
+
+ channel->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s removed %s from the channel", channel->name, user->nick, target->nick);
+ target->WriteServ("NOTICE %s :*** %s removed you from %s with the message: %s", target->nick, user->nick, channel->name, reasonparam.c_str());
+
+ if (!channel->PartUser(target, reason.c_str()))
+ delete channel;
+ }
+ else