- Srv->SendOpers(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 send the 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 generate the users JOIN or FJOIN instead.
+ */
+ if (IS_LOCAL(dest))
+ {
+ Channel::JoinUser(dest, parameters[1], true, "", false, ServerInstance->Time());
+ /* Fix for dotslasher and w00t - if the join didnt succeed, return CMD_FAILURE so that it doesnt propagate */
+ Channel* n = ServerInstance->FindChan(parameters[1]);
+ if (n)
+ {
+ if (n->HasUser(dest))
+ {
+ ServerInstance->SNO->WriteToSnoMask('a', user->nick+" used SAJOIN to make "+dest->nick+" join "+parameters[1]);
+ return CMD_SUCCESS;
+ }
+ else
+ {
+ user->WriteServ("NOTICE "+user->nick+" :*** Could not join "+dest->nick+" to "+parameters[1]+" (User is probably banned, or blocking modes)");
+ return CMD_FAILURE;
+ }
+ }
+ else
+ {
+ user->WriteServ("NOTICE "+user->nick+" :*** Could not join "+dest->nick+" to "+parameters[1]);
+ return CMD_FAILURE;
+ }
+ }
+ else
+ {
+ ServerInstance->SNO->WriteToSnoMask('a', user->nick+" sent remote SAJOIN to make "+dest->nick+" join "+parameters[1]);
+ return CMD_SUCCESS;
+ }
+ }
+ else
+ {
+ user->WriteServ("NOTICE "+user->nick+" :*** No such nickname "+parameters[0]);
+ return CMD_FAILURE;