mirror of
https://github.com/anope/anope.git
synced 2026-06-29 17:56:37 +02:00
Merge branch '2.0' into 2.1.
This commit is contained in:
@@ -149,6 +149,9 @@ while [ $# -ge 1 ] ; do
|
||||
echo "-nointro Skip intro (disclaimer, etc)"
|
||||
echo "-quick Skip questions, go straight to cmake"
|
||||
exit 0
|
||||
elif [ $1 = "-devel" ] ; then
|
||||
DEBUG="yes"
|
||||
INSTDIR="$PWD/run"
|
||||
elif [ $1 = "-nocache" ] ; then
|
||||
IGNORE_CACHE="1"
|
||||
elif [ $1 = "-nointro" ] ; then
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ namespace Language
|
||||
#define CHAN_X_SUSPENDED _("Channel %s is currently suspended.")
|
||||
#define CHAN_X_NOT_REGISTERED _("Channel \002%s\002 isn't registered.")
|
||||
#define CHAN_X_NOT_IN_USE _("Channel \002%s\002 doesn't exist.")
|
||||
#define NICK_IDENTIFY_REQUIRED _("Password authentication required for that command.")
|
||||
#define NICK_IDENTIFY_REQUIRED _("You must be logged into an account to use that command.")
|
||||
#define MAIL_X_INVALID _("\002%s\002 is not a valid e-mail address.")
|
||||
#define UNKNOWN _("<unknown>")
|
||||
#define NO_EXPIRE _("does not expire")
|
||||
|
||||
+1
-1
@@ -221,7 +221,7 @@ class CoreExport ChannelModeVirtual : public T
|
||||
|
||||
ChannelMode *Wrap(Anope::string ¶m) anope_override;
|
||||
|
||||
ChannelMode *Unwrap(ChannelMode *cm, Anope::string ¶m) = 0;
|
||||
ChannelMode *Unwrap(ChannelMode *cm, Anope::string ¶m) anope_override = 0;
|
||||
};
|
||||
|
||||
/* The status a user has on a channel (+v, +h, +o) etc */
|
||||
|
||||
@@ -34,7 +34,7 @@ class AccessChanAccess : public ChanAccess
|
||||
return this->ci->GetLevel(name) != ACCESS_INVALID && this->level >= this->ci->GetLevel(name);
|
||||
}
|
||||
|
||||
Anope::string AccessSerialize() const
|
||||
Anope::string AccessSerialize() const anope_override
|
||||
{
|
||||
return stringify(this->level);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ class FlagsChanAccess : public ChanAccess
|
||||
return false;
|
||||
}
|
||||
|
||||
Anope::string AccessSerialize() const
|
||||
Anope::string AccessSerialize() const anope_override
|
||||
{
|
||||
return Anope::string(this->flags.begin(), this->flags.end());
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class XOPChanAccess : public ChanAccess
|
||||
return false;
|
||||
}
|
||||
|
||||
Anope::string AccessSerialize() const
|
||||
Anope::string AccessSerialize() const anope_override
|
||||
{
|
||||
return this->type;
|
||||
}
|
||||
@@ -489,7 +489,7 @@ class CommandCSXOP : public Command
|
||||
return Anope::printf(Language::Translate(source.GetAccount(), _("Modify the list of %s users")), source.command.upper().c_str());
|
||||
}
|
||||
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms)
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override
|
||||
{
|
||||
ChannelInfo *ci = ChannelInfo::Find(params[0]);
|
||||
if (ci == NULL)
|
||||
|
||||
@@ -60,6 +60,7 @@ class CommandNSInfo : public Command
|
||||
|
||||
InfoFormatter info(source.nc);
|
||||
|
||||
info[_("Account")] = na->nc->display;
|
||||
if (nick_online)
|
||||
{
|
||||
bool shown = false;
|
||||
|
||||
@@ -179,6 +179,7 @@ class CommandNSRegister : public Command
|
||||
}
|
||||
|
||||
if (Config->GetModule("nickserv")->Get<bool>("restrictopernicks"))
|
||||
{
|
||||
for (unsigned i = 0; i < Oper::opers.size(); ++i)
|
||||
{
|
||||
Oper *o = Oper::opers[i];
|
||||
@@ -189,6 +190,7 @@ class CommandNSRegister : public Command
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int passlen = Config->GetModule("nickserv")->Get<unsigned>("passlen", "32");
|
||||
|
||||
|
||||
@@ -111,12 +111,12 @@ class MyNewsService : public NewsService
|
||||
return new MyNewsItem();
|
||||
}
|
||||
|
||||
void AddNewsItem(NewsItem *n)
|
||||
void AddNewsItem(NewsItem *n) anope_override
|
||||
{
|
||||
this->newsItems[n->type].push_back(n);
|
||||
}
|
||||
|
||||
void DelNewsItem(NewsItem *n)
|
||||
void DelNewsItem(NewsItem *n) anope_override
|
||||
{
|
||||
std::vector<NewsItem *> &list = this->GetNewsList(n->type);
|
||||
std::vector<NewsItem *>::iterator it = std::find(list.begin(), list.end(), n);
|
||||
@@ -125,7 +125,7 @@ class MyNewsService : public NewsService
|
||||
delete n;
|
||||
}
|
||||
|
||||
std::vector<NewsItem *> &GetNewsList(NewsType t)
|
||||
std::vector<NewsItem *> &GetNewsList(NewsType t) anope_override
|
||||
{
|
||||
return this->newsItems[t];
|
||||
}
|
||||
|
||||
@@ -253,12 +253,12 @@ class CommandOSSXLineBase : public Command
|
||||
return;
|
||||
}
|
||||
|
||||
virtual bool OnHelp(CommandSource &source, const Anope::string &subcommand) = 0;
|
||||
virtual bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override = 0;
|
||||
};
|
||||
|
||||
class CommandOSSNLine : public CommandOSSXLineBase
|
||||
{
|
||||
XLineManager *xlm()
|
||||
XLineManager *xlm() anope_override
|
||||
{
|
||||
return this->snlines;
|
||||
}
|
||||
@@ -484,7 +484,7 @@ class CommandOSSNLine : public CommandOSSXLineBase
|
||||
|
||||
class CommandOSSQLine : public CommandOSSXLineBase
|
||||
{
|
||||
XLineManager *xlm()
|
||||
XLineManager *xlm() anope_override
|
||||
{
|
||||
return this->sqlines;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ void IRC2SQL::CheckTables()
|
||||
"`countryname` varchar(50),"
|
||||
"PRIMARY KEY `end` (`end`),"
|
||||
"KEY `start` (`start`)"
|
||||
") ENGINE=MyISAM DEFAULT CHARSET=utf8;";
|
||||
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
|
||||
this->RunQuery(query);
|
||||
}
|
||||
if (GeoIPDB.equals_ci("city") && !this->HasTable(prefix + "geoip_city_blocks"))
|
||||
@@ -45,7 +45,7 @@ void IRC2SQL::CheckTables()
|
||||
"`locId` INT UNSIGNED NOT NULL,"
|
||||
"PRIMARY KEY `end` (`end`),"
|
||||
"KEY `start` (`start`)"
|
||||
") ENGINE=MyISAM DEFAULT CHARSET=utf8;";
|
||||
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
|
||||
this->RunQuery(query);
|
||||
|
||||
}
|
||||
@@ -60,7 +60,7 @@ void IRC2SQL::CheckTables()
|
||||
"`longitude` FLOAT,"
|
||||
"`areaCode` INT,"
|
||||
"PRIMARY KEY (`locId`)"
|
||||
") ENGINE=MyISAM DEFAULT CHARSET=utf8;";
|
||||
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
|
||||
this->RunQuery(query);
|
||||
}
|
||||
if (GeoIPDB.equals_ci("city") && !this->HasTable(prefix + "geoip_city_region"))
|
||||
@@ -69,7 +69,7 @@ void IRC2SQL::CheckTables()
|
||||
"`region` CHAR(2) NOT NULL,"
|
||||
"`regionname` VARCHAR(100) NOT NULL,"
|
||||
"PRIMARY KEY (`country`,`region`)"
|
||||
") ENGINE=MyISAM DEFAULT CHARSET=utf8;";
|
||||
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
|
||||
this->RunQuery(query);
|
||||
}
|
||||
if (!this->HasTable(prefix + "server"))
|
||||
@@ -87,7 +87,7 @@ void IRC2SQL::CheckTables()
|
||||
"`ulined` enum('Y','N') NOT NULL DEFAULT 'N',"
|
||||
"PRIMARY KEY (`id`),"
|
||||
"UNIQUE KEY `name` (`name`)"
|
||||
") ENGINE=MyISAM DEFAULT CHARSET=utf8;";
|
||||
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
|
||||
this->RunQuery(query);
|
||||
}
|
||||
if (!this->HasTable(prefix + "chan"))
|
||||
@@ -101,7 +101,7 @@ void IRC2SQL::CheckTables()
|
||||
"`modes` varchar(512) DEFAULT NULL,"
|
||||
"PRIMARY KEY (`chanid`),"
|
||||
"UNIQUE KEY `channel`(`channel`)"
|
||||
") ENGINE=MyISAM DEFAULT CHARSET=utf8;";
|
||||
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
|
||||
this->RunQuery(query);
|
||||
}
|
||||
if (!this->HasTable(prefix + "user"))
|
||||
@@ -136,7 +136,7 @@ void IRC2SQL::CheckTables()
|
||||
"PRIMARY KEY (`nickid`),"
|
||||
"UNIQUE KEY `nick` (`nick`),"
|
||||
"KEY `servid` (`servid`)"
|
||||
") ENGINE=MyISAM DEFAULT CHARSET=utf8;";
|
||||
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
|
||||
this->RunQuery(query);
|
||||
}
|
||||
if (!this->HasTable(prefix + "ison"))
|
||||
@@ -147,7 +147,7 @@ void IRC2SQL::CheckTables()
|
||||
"`modes` varchar(255) NOT NULL default '',"
|
||||
"PRIMARY KEY (`nickid`,`chanid`),"
|
||||
"KEY `modes` (`modes`)"
|
||||
") ENGINE=MyISAM DEFAULT CHARSET=utf8;";
|
||||
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
|
||||
this->RunQuery(query);
|
||||
}
|
||||
if (!this->HasTable(prefix + "maxusers"))
|
||||
@@ -158,7 +158,7 @@ void IRC2SQL::CheckTables()
|
||||
"`maxtime` DATETIME NOT NULL,"
|
||||
"`lastused` DATETIME NOT NULL,"
|
||||
"UNIQUE KEY `name` (`name`)"
|
||||
") ENGINE=MyISAM DEFAULT CHARSET=utf8;";
|
||||
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
|
||||
this->RunQuery(query);
|
||||
}
|
||||
if (this->HasProcedure(prefix + "UserConnect"))
|
||||
|
||||
@@ -317,7 +317,7 @@ class MChanstats : public Module
|
||||
"KEY `nick` (`nick`),"
|
||||
"KEY `chan_` (`chan`),"
|
||||
"KEY `type` (`type`)"
|
||||
") ENGINE=MyISAM DEFAULT CHARSET=utf8;";
|
||||
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
|
||||
this->RunQuery(query);
|
||||
}
|
||||
/* There is no CREATE OR REPLACE PROCEDURE in MySQL */
|
||||
|
||||
+1
-1
@@ -208,7 +208,7 @@ class Fantasy : public Module
|
||||
FOREACH_MOD(OnPostCommand, (source, cmd, params));
|
||||
}
|
||||
|
||||
void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info)
|
||||
void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) anope_override
|
||||
{
|
||||
if (fantasy.HasExt(ci))
|
||||
info.AddOption(_("Fantasy"));
|
||||
|
||||
+1
-1
@@ -326,7 +326,7 @@ class MyHTTPProvider : public HTTPProvider, public Timer
|
||||
this->pages.erase(page->GetURL());
|
||||
}
|
||||
|
||||
HTTPPage* FindPage(const Anope::string &pname)
|
||||
HTTPPage* FindPage(const Anope::string &pname) anope_override
|
||||
{
|
||||
if (this->pages.count(pname) == 0)
|
||||
return NULL;
|
||||
|
||||
@@ -39,12 +39,12 @@ class MyXMLRPCServiceInterface : public XMLRPCServiceInterface, public HTTPPage
|
||||
public:
|
||||
MyXMLRPCServiceInterface(Module *creator, const Anope::string &sname) : XMLRPCServiceInterface(creator, sname), HTTPPage("/xmlrpc", "text/xml") { }
|
||||
|
||||
void Register(XMLRPCEvent *event)
|
||||
void Register(XMLRPCEvent *event) anope_override
|
||||
{
|
||||
this->events.push_back(event);
|
||||
}
|
||||
|
||||
void Unregister(XMLRPCEvent *event)
|
||||
void Unregister(XMLRPCEvent *event) anope_override
|
||||
{
|
||||
std::deque<XMLRPCEvent *>::iterator it = std::find(this->events.begin(), this->events.end(), event);
|
||||
|
||||
@@ -182,7 +182,7 @@ class MyXMLRPCServiceInterface : public XMLRPCServiceInterface, public HTTPPage
|
||||
return true;
|
||||
}
|
||||
|
||||
void Reply(XMLRPCRequest &request)
|
||||
void Reply(XMLRPCRequest &request) anope_override
|
||||
{
|
||||
if (!request.id.empty())
|
||||
request.reply("id", request.id);
|
||||
|
||||
@@ -129,7 +129,7 @@ class MemoServCore : public Module, public MemoServService
|
||||
return MEMO_SUCCESS;
|
||||
}
|
||||
|
||||
void Check(User *u)
|
||||
void Check(User *u) anope_override
|
||||
{
|
||||
const NickCore *nc = u->Account();
|
||||
if (!nc)
|
||||
|
||||
@@ -495,14 +495,14 @@ class NickServCore : public Module, public NickServService
|
||||
"after %d days if not used."), nickserv_expire / 86400);
|
||||
}
|
||||
|
||||
void OnNickCoreCreate(NickCore *nc)
|
||||
void OnNickCoreCreate(NickCore *nc) anope_override
|
||||
{
|
||||
/* Set default flags */
|
||||
for (unsigned i = 0; i < defaults.size(); ++i)
|
||||
nc->Extend<bool>(defaults[i].upper());
|
||||
}
|
||||
|
||||
void OnUserQuit(User *u, const Anope::string &msg)
|
||||
void OnUserQuit(User *u, const Anope::string &msg) anope_override
|
||||
{
|
||||
if (u->server && !u->server->GetQuitReason().empty() && Config->GetModule(this)->Get<bool>("hidenetsplitquit"))
|
||||
return;
|
||||
|
||||
+2
-2
@@ -62,9 +62,9 @@ BotInfo::~BotInfo()
|
||||
IRCD->SendSQLineDel(&x);
|
||||
}
|
||||
|
||||
for (std::set<ChannelInfo *>::iterator it = this->channels->begin(), it_end = this->channels->end(); it != it_end; ++it)
|
||||
for (std::set<ChannelInfo *>::iterator it = this->channels->begin(), it_end = this->channels->end(); it != it_end;)
|
||||
{
|
||||
ChannelInfo *ci = *it;
|
||||
ChannelInfo *ci = *it++;
|
||||
this->UnAssign(NULL, ci);
|
||||
}
|
||||
|
||||
|
||||
+9
-4
@@ -106,9 +106,12 @@ void Anope::Fork()
|
||||
#ifndef _WIN32
|
||||
kill(getppid(), SIGUSR2);
|
||||
|
||||
freopen("/dev/null", "r", stdin);
|
||||
freopen("/dev/null", "w", stdout);
|
||||
freopen("/dev/null", "w", stderr);
|
||||
if (!freopen("/dev/null", "r", stdin))
|
||||
Log() << "Unable to redirect stdin to /dev/null: " << Anope::LastError();
|
||||
if (!freopen("/dev/null", "w", stdout))
|
||||
Log() << "Unable to redirect stdout to /dev/null: " << Anope::LastError();
|
||||
if (!freopen("/dev/null", "w", stderr))
|
||||
Log() << "Unable to redirect stderr to /dev/null: " << Anope::LastError();
|
||||
|
||||
setpgid(0, 0);
|
||||
|
||||
@@ -263,7 +266,9 @@ static void setuidgid()
|
||||
{
|
||||
LogFile* lf = li.logfiles[j];
|
||||
|
||||
chown(lf->filename.c_str(), uid, gid);
|
||||
errno = 0;
|
||||
if (chown(lf->filename.c_str(), uid, gid) != 0)
|
||||
Log() << "Unable to change the ownership of " << lf->filename << " to " << uid << "/" << gid << ": " << Anope::LastError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -112,9 +112,9 @@ static std::string GetTimeStamp()
|
||||
{
|
||||
char tbuf[256];
|
||||
time_t t = time(NULL);
|
||||
struct tm *tm = localtime(&t);
|
||||
struct tm *tm = gmtime(&t);
|
||||
|
||||
strftime(tbuf, sizeof(tbuf) - 1, "%a, %d %b %Y %H:%M:%S %z", tm);
|
||||
strftime(tbuf, sizeof(tbuf) - 1, "%a, %d %b %Y %H:%M:%S +0000", tm);
|
||||
|
||||
return tbuf;
|
||||
}
|
||||
|
||||
+1
-2
@@ -94,14 +94,13 @@ UplinkSocket::~UplinkSocket()
|
||||
}
|
||||
|
||||
IRCD->SendSquit(Me, Anope::QuitReason);
|
||||
|
||||
this->ProcessWrite(); // Write out the last bit
|
||||
}
|
||||
|
||||
for (unsigned i = Me->GetLinks().size(); i > 0; --i)
|
||||
if (!Me->GetLinks()[i - 1]->IsJuped())
|
||||
Me->GetLinks()[i - 1]->Delete(Me->GetName() + " " + Me->GetLinks()[i - 1]->GetName());
|
||||
|
||||
this->ProcessWrite(); // Write out the last bit
|
||||
UplinkSock = NULL;
|
||||
|
||||
Me->Unsync();
|
||||
|
||||
Reference in New Issue
Block a user