mirror of
https://github.com/anope/anope.git
synced 2026-07-10 22:03:13 +02:00
Added options:nonicknameownership config option
This commit is contained in:
@@ -218,13 +218,6 @@ class BahamutIRCdProto : public IRCDProto
|
||||
send_cmd("", "NICK %s 1 %ld %s %s %s %s 0 0 :%s", u->nick.c_str(), static_cast<long>(u->timestamp), modes.c_str(), u->GetIdent().c_str(), u->host.c_str(), u->server->GetName().c_str(), u->realname.c_str());
|
||||
}
|
||||
|
||||
/* SVSMODE +d */
|
||||
/* nc_change was = 1, and there is no na->status */
|
||||
void SendUnregisteredNick(const User *u)
|
||||
{
|
||||
ircdproto->SendMode(findbot(Config->NickServ), u, "+d 1");
|
||||
}
|
||||
|
||||
/* SERVER */
|
||||
void SendServer(const Server *server)
|
||||
{
|
||||
@@ -240,14 +233,6 @@ class BahamutIRCdProto : public IRCDProto
|
||||
bahamut_cmd_burst();
|
||||
}
|
||||
|
||||
void SetAutoIdentificationToken(User *u)
|
||||
{
|
||||
if (!u->Account())
|
||||
return;
|
||||
|
||||
ircdproto->SendMode(findbot(Config->NickServ), u, "+d %d", u->timestamp);
|
||||
}
|
||||
|
||||
void SendChannel(Channel *c)
|
||||
{
|
||||
Anope::string modes = c->GetModes(true, true);
|
||||
@@ -255,6 +240,18 @@ class BahamutIRCdProto : public IRCDProto
|
||||
modes = "+";
|
||||
send_cmd("", "SJOIN %ld %s %s :", static_cast<long>(c->creation_time), c->name.c_str(), modes.c_str());
|
||||
}
|
||||
|
||||
void SendLogin(User *u)
|
||||
{
|
||||
BotInfo *ns = findbot(Config->NickServ);
|
||||
ircdproto->SendMode(ns, u, "+d %d", u->timestamp);
|
||||
}
|
||||
|
||||
void SendLogout(User *u)
|
||||
{
|
||||
BotInfo *ns = findbot(Config->NickServ);
|
||||
ircdproto->SendMode(ns, u, "+d 1");
|
||||
}
|
||||
};
|
||||
|
||||
class BahamutIRCdMessage : public IRCdMessage
|
||||
@@ -303,7 +300,7 @@ class BahamutIRCdMessage : public IRCdMessage
|
||||
if (user->timestamp == convertTo<time_t>(params[7]) && (na = findnick(user->nick)))
|
||||
{
|
||||
user->Login(na->nc);
|
||||
if (na->nc->HasFlag(NI_UNCONFIRMED) == false)
|
||||
if (!Config->NoNicknameOwnership && na->nc->HasFlag(NI_UNCONFIRMED) == false)
|
||||
user->SetMode(findbot(Config->NickServ), UMODE_REGISTERED);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -239,12 +239,15 @@ class InspIRCdTS6Proto : public IRCDProto
|
||||
send_cmd(source ? source->GetUID() : Config->Numeric, "SNONOTICE A :%s", buf.c_str());
|
||||
}
|
||||
|
||||
void SendAccountLogin(const User *u, const NickCore *account)
|
||||
void SendLogin(User *u)
|
||||
{
|
||||
send_cmd(Config->Numeric, "METADATA %s accountname :%s", u->GetUID().c_str(), account->display.c_str());
|
||||
if (!u->Account() || u->Account()->HasFlag(NI_UNCONFIRMED))
|
||||
return;
|
||||
|
||||
send_cmd(Config->Numeric, "METADATA %s accountname :%s", u->GetUID().c_str(), u->Account()->display.c_str());
|
||||
}
|
||||
|
||||
void SendAccountLogout(const User *u, const NickCore *account)
|
||||
void SendLogout(User *u)
|
||||
{
|
||||
send_cmd(Config->Numeric, "METADATA %s accountname :", u->GetUID().c_str());
|
||||
}
|
||||
|
||||
@@ -261,16 +261,18 @@ class InspIRCdProto : public IRCDProto
|
||||
send_cmd("", "ENDBURST");
|
||||
}
|
||||
|
||||
void SetAutoIdentificationToken(User *u)
|
||||
void SendLogin(User *u)
|
||||
{
|
||||
if (!u->Account())
|
||||
return;
|
||||
|
||||
Anope::string svidbuf = stringify(u->timestamp);
|
||||
|
||||
u->Account()->Extend("authenticationtoken", new ExtensibleString(svidbuf));
|
||||
}
|
||||
|
||||
void SendLogout(User *u)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class ChannelModeFlood : public ChannelModeParam
|
||||
@@ -324,7 +326,7 @@ class InspircdIRCdMessage : public IRCdMessage
|
||||
if (na && svidbuf && *svidbuf == params[0])
|
||||
{
|
||||
user->Login(na->nc);
|
||||
if (na->nc->HasFlag(NI_UNCONFIRMED))
|
||||
if (!Config->NoNicknameOwnership && na->nc->HasFlag(NI_UNCONFIRMED) == false)
|
||||
user->SetMode(findbot(Config->NickServ), UMODE_REGISTERED);
|
||||
}
|
||||
else if (nickserv)
|
||||
|
||||
@@ -269,7 +269,7 @@ bool event_metadata(const Anope::string &source, const std::vector<Anope::string
|
||||
u->Login(nc);
|
||||
|
||||
NickAlias *user_na = findnick(u->nick);
|
||||
if (nickserv && user_na && user_na->nc == nc && user_na->nc->HasFlag(NI_UNCONFIRMED) == false)
|
||||
if (!Config->NoNicknameOwnership && nickserv && user_na && user_na->nc == nc && user_na->nc->HasFlag(NI_UNCONFIRMED) == false)
|
||||
u->SetMode(findbot(Config->NickServ), UMODE_REGISTERED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ bool event_metadata(const Anope::string &source, const std::vector<Anope::string
|
||||
u->Login(nc);
|
||||
|
||||
NickAlias *user_na = findnick(u->nick);
|
||||
if (nickserv && user_na && user_na->nc == nc && user_na->nc->HasFlag(NI_UNCONFIRMED) == false)
|
||||
if (!Config->NoNicknameOwnership && nickserv && user_na && user_na->nc == nc && user_na->nc->HasFlag(NI_UNCONFIRMED) == false)
|
||||
u->SetMode(findbot(Config->NickServ), UMODE_REGISTERED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,12 +226,15 @@ class PlexusProto : public IRCDProto
|
||||
send_cmd(source->GetUID(), "INVITE %s %s", u ? u->GetUID().c_str() : nick.c_str(), chan.c_str());
|
||||
}
|
||||
|
||||
void SendAccountLogin(const User *u, const NickCore *account)
|
||||
void SendLogin(User *u)
|
||||
{
|
||||
send_cmd(Config->Numeric, "ENCAP * SU %s %s", u->GetUID().c_str(), account->display.c_str());
|
||||
if (!u->Account())
|
||||
return;
|
||||
|
||||
send_cmd(Config->Numeric, "ENCAP * SU %s %s", u->GetUID().c_str(), u->Account()->display.c_str());
|
||||
}
|
||||
|
||||
void SendAccountLogout(const User *u, const NickCore *account)
|
||||
void SendLogout(User *u)
|
||||
{
|
||||
send_cmd(Config->Numeric, "ENCAP * SU %s", u->GetUID().c_str());
|
||||
}
|
||||
@@ -558,7 +561,7 @@ bool event_encap(const Anope::string &source, const std::vector<Anope::string> &
|
||||
if (u && nc)
|
||||
{
|
||||
u->Login(nc);
|
||||
if (user_na && user_na->nc == nc && user_na->nc->HasFlag(NI_UNCONFIRMED) == false)
|
||||
if (!Config->NoNicknameOwnership && user_na && user_na->nc == nc && user_na->nc->HasFlag(NI_UNCONFIRMED) == false)
|
||||
u->SetMode(findbot(Config->NickServ), UMODE_REGISTERED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,12 +207,15 @@ class RatboxProto : public IRCDProto
|
||||
send_cmd(source->GetUID(), "INVITE %s %s", u ? u->GetUID().c_str() : nick.c_str(), chan.c_str());
|
||||
}
|
||||
|
||||
void SendAccountLogin(const User *u, const NickCore *account)
|
||||
void SendLogin(User *u)
|
||||
{
|
||||
send_cmd(Config->Numeric, "ENCAP * SU %s %s", u->GetUID().c_str(), account->display.c_str());
|
||||
if (!u->Account())
|
||||
return;
|
||||
|
||||
send_cmd(Config->Numeric, "ENCAP * SU %s %s", u->GetUID().c_str(), u->Account()->display.c_str());
|
||||
}
|
||||
|
||||
void SendAccountLogout(const User *u, const NickCore *account)
|
||||
void SendLogout(User *u)
|
||||
{
|
||||
send_cmd(Config->Numeric, "ENCAP * SU %s", u->GetUID().c_str());
|
||||
}
|
||||
@@ -479,6 +482,10 @@ bool event_encap(const Anope::string &source, const std::vector<Anope::string> &
|
||||
if (!u || !nc)
|
||||
return true;
|
||||
u->Login(nc);
|
||||
|
||||
NickAlias *user_na = findnick(u->nick);
|
||||
if (!Config->NoNicknameOwnership && user_na && user_na->nc == nc && user_na->nc->HasFlag(NI_UNCONFIRMED) == false)
|
||||
u->SetMode(findbot(Config->NickServ), UMODE_REGISTERED);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -318,17 +318,19 @@ class UnrealIRCdProto : public IRCDProto
|
||||
return true;
|
||||
}
|
||||
|
||||
void SetAutoIdentificationToken(User *u)
|
||||
void SendLogin(User *u)
|
||||
{
|
||||
if (!u->Account())
|
||||
return;
|
||||
|
||||
ircdproto->SendMode(findbot(Config->NickServ), u, "+d %d", u->timestamp);
|
||||
BotInfo *ns = findbot(Config->NickServ);
|
||||
ircdproto->SendMode(ns, u, "+d %d", u->timestamp);
|
||||
}
|
||||
|
||||
void SendUnregisteredNick(const User *u)
|
||||
void SendLogout(User *u)
|
||||
{
|
||||
ircdproto->SendMode(findbot(Config->NickServ), u, "+d 1");
|
||||
BotInfo *ns = findbot(Config->NickServ);
|
||||
ircdproto->SendMode(ns, u, "+d 1");
|
||||
}
|
||||
|
||||
void SendChannel(Channel *c)
|
||||
@@ -532,7 +534,7 @@ class Unreal32IRCdMessage : public IRCdMessage
|
||||
if (na && user->timestamp == convertTo<time_t>(params[6]))
|
||||
{
|
||||
user->Login(na->nc);
|
||||
if (na->nc->HasFlag(NI_UNCONFIRMED) == false && nickserv)
|
||||
if (!Config->NoNicknameOwnership && na->nc->HasFlag(NI_UNCONFIRMED) == false && nickserv)
|
||||
user->SetMode(findbot(Config->NickServ), UMODE_REGISTERED);
|
||||
}
|
||||
else if (nickserv)
|
||||
@@ -554,7 +556,7 @@ class Unreal32IRCdMessage : public IRCdMessage
|
||||
if (na && user->timestamp == convertTo<time_t>(params[6]))
|
||||
{
|
||||
user->Login(na->nc);
|
||||
if (na->nc->HasFlag(NI_UNCONFIRMED) == false && nickserv)
|
||||
if (!Config->NoNicknameOwnership && na->nc->HasFlag(NI_UNCONFIRMED) == false && nickserv)
|
||||
user->SetMode(findbot(Config->NickServ), UMODE_REGISTERED);
|
||||
}
|
||||
else if (nickserv)
|
||||
|
||||
Reference in New Issue
Block a user