mirror of
https://github.com/anope/anope.git
synced 2026-06-30 16:46:38 +02:00
Clean up ngircd proto mod slightly, and send sqlines before introducing clients
This commit is contained in:
@@ -49,14 +49,12 @@ class InspIRCdTS6Proto : public IRCDProto
|
||||
|
||||
void SendAddLine(const Anope::string &type, const Anope::string &mask, time_t duration, const Anope::string &addedby, const Anope::string &reason)
|
||||
{
|
||||
const BotInfo *bi = findbot(Config->OperServ);
|
||||
UplinkSocket::Message(bi) << "ADDLINE " << type << " " << mask << " " << addedby << " " << Anope::CurTime << " " << duration << " :" << reason;
|
||||
UplinkSocket::Message(Me) << "ADDLINE " << type << " " << mask << " " << addedby << " " << Anope::CurTime << " " << duration << " :" << reason;
|
||||
}
|
||||
|
||||
void SendDelLine(const Anope::string &type, const Anope::string &mask)
|
||||
{
|
||||
const BotInfo *bi = findbot(Config->OperServ);
|
||||
UplinkSocket::Message(bi) << "DELLINE " << type << " " << mask;
|
||||
UplinkSocket::Message(Me) << "DELLINE " << type << " " << mask;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
@@ -45,8 +45,6 @@ class ngIRCdProto : public IRCDProto
|
||||
void SendClientIntroduction(const User *u) anope_override
|
||||
{
|
||||
Anope::string modes = "+" + u->GetModes();
|
||||
XLine x(u->nick, "Reserved for services");
|
||||
ircdproto->SendSQLine(NULL, &x);
|
||||
UplinkSocket::Message(Me) << "NICK " << u->nick << " 1 " << u->GetIdent() << " " << u->host << " 1 " << modes << " :" << u->realname;
|
||||
}
|
||||
|
||||
@@ -106,9 +104,9 @@ class ngIRCdProto : public IRCDProto
|
||||
UplinkSocket::Message(bi) << "KICK " << chan->name << " " << user->nick;
|
||||
}
|
||||
|
||||
void SendLogin(User *u) { } anope_override
|
||||
void SendLogin(User *u) anope_override { }
|
||||
|
||||
void SendLogout(User *u) { } anope_override
|
||||
void SendLogout(User *u) anope_override { }
|
||||
|
||||
void SendModeInternal(const BotInfo *bi, const Channel *dest, const Anope::string &buf) anope_override
|
||||
{
|
||||
@@ -180,7 +178,7 @@ struct IRCDMessage005 : IRCDMessage
|
||||
unsigned newlen = convertTo<unsigned>(data);
|
||||
if (Config->NickLen != newlen)
|
||||
{
|
||||
Log() << "Config->NickLen changed from " << Config->NickLen << " to " << newlen;
|
||||
Log() << "NickLen changed from " << Config->NickLen << " to " << newlen;
|
||||
Config->NickLen = newlen;
|
||||
}
|
||||
}
|
||||
@@ -190,7 +188,6 @@ struct IRCDMessage005 : IRCDMessage
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct IRCDMessage376 : IRCDMessage
|
||||
{
|
||||
IRCDMessage376() : IRCDMessage("376", 2) { }
|
||||
@@ -209,8 +206,6 @@ struct IRCDMessage376 : IRCDMessage
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct IRCDMessageChaninfo : IRCDMessage
|
||||
{
|
||||
IRCDMessageChaninfo() : IRCDMessage("CHANINFO", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); SetFlag(IRCDMESSAGE_REQUIRE_SERVER); }
|
||||
|
||||
+2
-2
@@ -37,10 +37,10 @@ BotInfo::BotInfo(const Anope::string &nnick, const Anope::string &nuser, const A
|
||||
if (!tmodes.empty())
|
||||
this->SetModesInternal(tmodes.c_str());
|
||||
|
||||
ircdproto->SendClientIntroduction(this);
|
||||
this->introduced = true;
|
||||
XLine x(this->nick, "Reserved for services");
|
||||
ircdproto->SendSQLine(NULL, &x);
|
||||
ircdproto->SendClientIntroduction(this);
|
||||
this->introduced = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
-4
@@ -47,15 +47,18 @@ void introduce_user(const Anope::string &user)
|
||||
User *u = finduser(user);
|
||||
if (u)
|
||||
{
|
||||
ircdproto->SendClientIntroduction(u);
|
||||
|
||||
BotInfo *bi = findbot(u->nick);
|
||||
if (bi)
|
||||
{
|
||||
bi->introduced = true;
|
||||
|
||||
XLine x(bi->nick, "Reserved for services");
|
||||
ircdproto->SendSQLine(NULL, &x);
|
||||
}
|
||||
|
||||
ircdproto->SendClientIntroduction(u);
|
||||
|
||||
if (bi)
|
||||
{
|
||||
bi->introduced = true;
|
||||
|
||||
for (UChannelList::const_iterator cit = bi->chans.begin(), cit_end = bi->chans.end(); cit != cit_end; ++cit)
|
||||
ircdproto->SendJoin(bi, (*cit)->chan, &Config->BotModeList);
|
||||
|
||||
+4
-3
@@ -95,15 +95,16 @@ Server::Server(Server *uplink, const Anope::string &name, unsigned hops, const A
|
||||
{
|
||||
User *u = it->second;
|
||||
|
||||
ircdproto->SendClientIntroduction(u);
|
||||
|
||||
BotInfo *bi = findbot(u->nick);
|
||||
if (bi)
|
||||
{
|
||||
bi->introduced = true;
|
||||
XLine x(bi->nick, "Reserved for services");
|
||||
ircdproto->SendSQLine(NULL, &x);
|
||||
}
|
||||
|
||||
ircdproto->SendClientIntroduction(u);
|
||||
if (bi)
|
||||
bi->introduced = true;
|
||||
}
|
||||
|
||||
for (channel_map::const_iterator it = ChannelList.begin(), it_end = ChannelList.end(); it != it_end; ++it)
|
||||
|
||||
Reference in New Issue
Block a user