1
0
mirror of https://github.com/anope/anope.git synced 2026-07-03 16:53:12 +02:00

Add support for oper-only quit messages.

This currently only works on InspIRCd but I believe that other
servers also support this.
This commit is contained in:
Sadie Powell
2025-03-09 18:51:03 +00:00
parent 314ef60900
commit 6d7fe69cdf
6 changed files with 14 additions and 6 deletions
+1 -1
View File
@@ -222,7 +222,7 @@ public:
virtual void SendContextNotice(BotInfo *bi, User *target, Channel *context, const Anope::string &msg);
virtual void SendContextPrivmsg(BotInfo *bi, User *target, Channel *context, const Anope::string &msg);
virtual void SendQuit(User *u, const Anope::string &msg);
virtual void SendQuit(User *u, const Anope::string &msg = "", const Anope::string &opermsg = "");
virtual void SendPing(const Anope::string &servname, const Anope::string &who);
virtual void SendPong(const Anope::string &servname, const Anope::string &who);
+2 -2
View File
@@ -106,7 +106,7 @@ public:
Anope::map<NickServRelease *>::iterator nit = NickServReleases.find(this->nick);
if (nit != NickServReleases.end())
{
IRCD->SendQuit(nit->second, "");
IRCD->SendQuit(nit->second);
delete nit->second;
}
@@ -117,7 +117,7 @@ public:
~NickServRelease() override
{
IRCD->SendQuit(this, "");
IRCD->SendQuit(this);
NickServReleases.erase(this->nick);
}
+8
View File
@@ -255,6 +255,14 @@ public:
Uplink::Send(user, "SVSCMODE", u->GetUID(), c->name, 'b');
}
void SendQuit(User *u, const Anope::string &buf, const Anope::string &operbuf)
{
if (!operbuf.empty())
Uplink::Send("METADATA", u->GetUID(), "operquit", operbuf);
IRCDProto::SendQuit(u, buf, operbuf);
}
void SendPong(const Anope::string &servname, const Anope::string &who) override
{
Server *serv = servname.empty() ? NULL : Server::Find(servname);
+1 -1
View File
@@ -66,7 +66,7 @@ BotInfo::~BotInfo()
// If we're synchronised with the uplink already, send the bot.
if (Me && Me->IsSynced())
{
IRCD->SendQuit(this, "");
IRCD->SendQuit(this);
FOREACH_MOD(OnUserQuit, (this, ""));
this->introduced = false;
XLine x(this->nick);
+1 -1
View File
@@ -151,7 +151,7 @@ void IRCDProto::SendTagmsg(const MessageSource &source, const Anope::string &des
Uplink::Send(tags, source, "TAGMSG", dest);
}
void IRCDProto::SendQuit(User *u, const Anope::string &buf)
void IRCDProto::SendQuit(User *u, const Anope::string &buf, const Anope::string &operbuf)
{
if (!buf.empty())
Uplink::Send(u, "QUIT", buf);
+1 -1
View File
@@ -130,7 +130,7 @@ UplinkSocket::~UplinkSocket()
if (u->server == Me)
{
/* Don't use quitmsg here, it may contain information you don't want people to see */
IRCD->SendQuit(u, "Shutting down");
IRCD->SendQuit(u, "Shutting down", Anope::QuitReason);
BotInfo *bi = BotInfo::Find(u->GetUID());
if (bi != NULL)
bi->introduced = false;