mirror of
https://github.com/anope/anope.git
synced 2026-07-10 22:03:13 +02:00
Interally quit servers when juped
This commit is contained in:
@@ -33,9 +33,11 @@ class CommandOSJupe : public Command
|
||||
else
|
||||
{
|
||||
Anope::string rbuf = "Juped by " + source.GetNick() + (!reason.empty() ? ": " + reason : "");
|
||||
/* Generate the new sid before quitting the old server, so they can't collide */
|
||||
Anope::string sid = Servers::TS6_SID_Retrieve();
|
||||
if (server)
|
||||
IRCD->SendSquit(server, rbuf);
|
||||
Server *juped_server = new Server(Me, jserver, 1, rbuf, Servers::TS6_SID_Retrieve(), true);
|
||||
Server *juped_server = new Server(Me, jserver, 1, rbuf, sid, true);
|
||||
IRCD->SendServer(juped_server);
|
||||
|
||||
Log(LOG_ADMIN, source, this) << "on " << jserver << " (" << rbuf << ")";
|
||||
|
||||
+1
-3
@@ -375,12 +375,10 @@ void SQuit::Run(MessageSource &source, const std::vector<Anope::string> ¶ms)
|
||||
|
||||
if (!s)
|
||||
{
|
||||
Log() << "SQUIT for nonexistent server " << params[0];
|
||||
Log(LOG_DEBUG) << "SQUIT for nonexistent server " << params[0];
|
||||
return;
|
||||
}
|
||||
|
||||
FOREACH_MOD(OnServerQuit, (s));
|
||||
|
||||
s->Delete(s->GetName() + " " + s->GetUplink()->GetName());
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -263,7 +263,8 @@ void IRCDProto::SendGlobops(const BotInfo *source, const char *fmt, ...)
|
||||
|
||||
void IRCDProto::SendSquit(Server *s, const Anope::string &message)
|
||||
{
|
||||
UplinkSocket::Message() << "SQUIT " << s->GetName() << " :" << message;
|
||||
UplinkSocket::Message() << "SQUIT " << s->GetSID() << " :" << message;
|
||||
s->Delete(message);
|
||||
}
|
||||
|
||||
void IRCDProto::SendNickChange(const User *u, const Anope::string &newnick)
|
||||
|
||||
@@ -178,7 +178,10 @@ const Anope::string &Server::GetDescription() const
|
||||
|
||||
void Server::SetSID(const Anope::string &nsid)
|
||||
{
|
||||
if (!this->sid.empty())
|
||||
throw CoreException("Server already has an id?");
|
||||
this->sid = nsid;
|
||||
Servers::ByID[nsid] = this;
|
||||
}
|
||||
|
||||
const Anope::string &Server::GetSID() const
|
||||
|
||||
+6
-1
@@ -173,7 +173,12 @@ UplinkSocket::Message::~Message()
|
||||
}
|
||||
else if (this->user != NULL)
|
||||
{
|
||||
if (this->user->server != Me && !this->user->server->IsJuped())
|
||||
if (this->user->server == NULL)
|
||||
{
|
||||
Log(LOG_DEBUG) << "Attempted to send \"" << this->buffer.str() << "\" from " << this->user->nick << " who has no server (I'm not introduced?)";
|
||||
return;
|
||||
}
|
||||
else if (this->user->server != Me && !this->user->server->IsJuped())
|
||||
{
|
||||
Log(LOG_DEBUG) << "Attempted to send \"" << this->buffer.str() << "\" from " << this->user->nick << " who is not from me?";
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user