- ServerInstance->WriteOpers(std::string(user->nick)+" used SAJOIN to make "+std::string(dest->nick)+" join "+parameters[1]);
- chanrec::JoinUser(ServerInstance, dest, parameters[1], true);
+ /* 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, channel, true);
+ if (n && n->HasUser(dest))
+ {
+ ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used SAJOIN to make "+dest->nick+" join "+channel);
+ return CMD_SUCCESS;
+ }
+ else
+ {
+ user->WriteNotice("*** Could not join "+dest->nick+" to "+channel);
+ return CMD_FAILURE;
+ }
+ }
+ else
+ {
+ return CMD_SUCCESS;
+ }
+ }
+ else
+ {
+ user->WriteNotice("*** No such nickname "+nickname);
+ return CMD_FAILURE;