summaryrefslogtreecommitdiff
path: root/src/modules/m_sajoin.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-08 16:16:25 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-08 16:16:25 +0000
commite295d91ffd44876a9ae5279269d5a4ca4e15afcc (patch)
treeb7564d2fa09b9f24562447d7ddd2b8d273faf369 /src/modules/m_sajoin.cpp
parent74da82aef979d75eb1d1a2a56f12d742fd5d4c87 (diff)
Make SAJOIN/SAPART more spanningtree friendly, they are throwbacks to the inspircd 1.0 alpha days :S
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6911 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_sajoin.cpp')
-rw-r--r--src/modules/m_sajoin.cpp33
1 files changed, 22 insertions, 11 deletions
diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp
index ad5aef213..b91b1a2f0 100644
--- a/src/modules/m_sajoin.cpp
+++ b/src/modules/m_sajoin.cpp
@@ -49,27 +49,38 @@ class cmd_sajoin : public command_t
return CMD_FAILURE;
}
- chanrec::JoinUser(ServerInstance, dest, parameters[1], true, "");
-
- /* Fix for dotslasher and w00t - if the join didnt succeed, return CMD_FAILURE so that it doesnt propogate */
- chanrec* n = ServerInstance->FindChan(parameters[1]);
- if (n)
+ /* 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 propogate it where it needs to be
+ * and then that server will generate the users JOIN or FJOIN instead.
+ */
+ if (IS_LOCAL(dest))
{
- if (n->HasUser(dest))
+ chanrec::JoinUser(ServerInstance, dest, parameters[1], true, "", ServerInstance->Time(true));
+ /* Fix for dotslasher and w00t - if the join didnt succeed, return CMD_FAILURE so that it doesnt propogate */
+ chanrec* n = ServerInstance->FindChan(parameters[1]);
+ if (n)
{
- ServerInstance->WriteOpers("*** "+std::string(user->nick)+" used SAJOIN to make "+std::string(dest->nick)+" join "+parameters[1]);
- return CMD_SUCCESS;
+ if (n->HasUser(dest))
+ {
+ ServerInstance->WriteOpers("*** "+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]+" (User is probably banned, or blocking modes)");
+ user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Could not join "+std::string(dest->nick)+" to "+parameters[1]);
return CMD_FAILURE;
}
}
else
{
- user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Could not join "+std::string(dest->nick)+" to "+parameters[1]);
- return CMD_FAILURE;
+ ServerInstance->WriteOpers("*** "+std::string(user->nick)+" sent remote SAJOIN to make "+std::string(dest->nick)+" join "+parameters[1]);
+ return CMD_SUCCESS;
}
}
else