- Srv->SendOpers(std::string(user->nick)+" used SAJOIN to make "+std::string(dest->nick)+" join "+parameters[1]);
- Srv->JoinUserToChannel(dest,std::string(parameters[1]),std::string(dest->nick));
+ /* 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(ServerInstance, dest, parameters[1].c_str(), 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', std::string(user->nick)+" used SAJOIN to make "+std::string(dest->nick)+" join "+parameters[1]);
+ return CMD_SUCCESS;
+ }
+ else
+ {
+ user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Could not join "+std::string(dest->nick)+" to "+parameters[1]+" (User is probably banned, or blocking modes)");
+ return CMD_FAILURE;
+ }
+ }
+ else
+ {
+ user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Could not join "+std::string(dest->nick)+" to "+parameters[1]);
+ return CMD_FAILURE;
+ }
+ }
+ else
+ {
+ ServerInstance->SNO->WriteToSnoMask('A', std::string(user->nick)+" sent remote SAJOIN to make "+std::string(dest->nick)+" join "+parameters[1]);
+ return CMD_SUCCESS;
+ }
+ }
+ else
+ {
+ user->WriteServ("NOTICE "+std::string(user->nick)+" :*** No such nickname "+parameters[0]);
+ return CMD_FAILURE;