+ if (ServerInstance->ULine(dest->server))
+ {
+ user->WriteNumeric(ERR_NOPRIVILEGES, "%s :Cannot use an SA command on a u-lined client",user->nick.c_str());
+ return CMD_FAILURE;
+ }
+ if (IS_LOCAL(user) && !ServerInstance->IsChannel(parameters[1].c_str(), ServerInstance->Config->Limits.ChanMax))
+ {
+ /* we didn't need to check this for each character ;) */
+ user->WriteServ("NOTICE "+user->nick+" :*** Invalid characters in channel name or name too long");
+ return CMD_FAILURE;
+ }
+
+ /* For local users, we call Channel::JoinUser which may create a channel and set its TS.
+ * For non-local users, we just return CMD_SUCCESS, knowing this will propagate it where it needs to be
+ * and then that server will handle the command.
+ */
+ LocalUser* localuser = IS_LOCAL(dest);
+ if (localuser)
+ {
+ Channel* n = Channel::JoinUser(localuser, parameters[1], true);
+ if (n)