From 9483da32392f65a663edcaacc9b00ff0430494ee Mon Sep 17 00:00:00 2001 From: PeGaSuS Date: Fri, 19 Feb 2021 02:42:13 +0100 Subject: Added `Account` to show the main nick of a grouped nick(s). #270 --- modules/commands/ns_info.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'modules') diff --git a/modules/commands/ns_info.cpp b/modules/commands/ns_info.cpp index 7a780c003..018872b7d 100644 --- a/modules/commands/ns_info.cpp +++ b/modules/commands/ns_info.cpp @@ -60,6 +60,7 @@ class CommandNSInfo : public Command InfoFormatter info(source.nc); + info[_("Account")] = na->nc->display; if (nick_online) { bool shown = false; -- cgit From faee68e85f23e50f6298dce93312b8a50afc2f88 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 16 Apr 2021 21:39:15 +0100 Subject: Don't enforce casemapping when using the 1202 InspIRCd protocol. This allows older servers which use a module that provides custom casemapping (e.g. the ascii module) to link. --- modules/protocol/inspircd20.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp index be478055f..3a557ae12 100644 --- a/modules/protocol/inspircd20.cpp +++ b/modules/protocol/inspircd20.cpp @@ -37,7 +37,7 @@ class InspIRCd20Proto : public IRCDProto void SendConnect() anope_override { UplinkSocket::Message() << "CAPAB START 1202"; - UplinkSocket::Message() << "CAPAB CAPABILITIES :PROTOCOL=1202 CASEMAPPING=" << Config->GetBlock("options")->Get("casemap", "ascii"); + UplinkSocket::Message() << "CAPAB CAPABILITIES :PROTOCOL=1202"; UplinkSocket::Message() << "CAPAB END"; insp12->SendConnect(); } -- cgit From 095a25d4731c7b2df73174eaedecae90aa1e610b Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 27 Apr 2021 21:41:19 +0100 Subject: Add the anope_override keyword to methods that lack it. --- modules/commands/cs_access.cpp | 2 +- modules/commands/cs_flags.cpp | 2 +- modules/commands/cs_xop.cpp | 4 ++-- modules/commands/os_news.cpp | 6 +++--- modules/commands/os_sxline.cpp | 6 +++--- modules/fantasy.cpp | 2 +- modules/m_httpd.cpp | 2 +- modules/m_xmlrpc.cpp | 6 +++--- modules/pseudoclients/memoserv.cpp | 2 +- modules/pseudoclients/nickserv.cpp | 4 ++-- 10 files changed, 18 insertions(+), 18 deletions(-) (limited to 'modules') diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp index 508274002..386978340 100644 --- a/modules/commands/cs_access.cpp +++ b/modules/commands/cs_access.cpp @@ -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); } diff --git a/modules/commands/cs_flags.cpp b/modules/commands/cs_flags.cpp index 179d04317..5fca415de 100644 --- a/modules/commands/cs_flags.cpp +++ b/modules/commands/cs_flags.cpp @@ -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()); } diff --git a/modules/commands/cs_xop.cpp b/modules/commands/cs_xop.cpp index 403920030..2b0cf413f 100644 --- a/modules/commands/cs_xop.cpp +++ b/modules/commands/cs_xop.cpp @@ -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 ¶ms) + void Execute(CommandSource &source, const std::vector ¶ms) anope_override { ChannelInfo *ci = ChannelInfo::Find(params[0]); if (ci == NULL) diff --git a/modules/commands/os_news.cpp b/modules/commands/os_news.cpp index d83e44025..f199cdad5 100644 --- a/modules/commands/os_news.cpp +++ b/modules/commands/os_news.cpp @@ -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 &list = this->GetNewsList(n->type); std::vector::iterator it = std::find(list.begin(), list.end(), n); @@ -125,7 +125,7 @@ class MyNewsService : public NewsService delete n; } - std::vector &GetNewsList(NewsType t) + std::vector &GetNewsList(NewsType t) anope_override { return this->newsItems[t]; } diff --git a/modules/commands/os_sxline.cpp b/modules/commands/os_sxline.cpp index 4a0e92ed4..167115194 100644 --- a/modules/commands/os_sxline.cpp +++ b/modules/commands/os_sxline.cpp @@ -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; } diff --git a/modules/fantasy.cpp b/modules/fantasy.cpp index 45223f398..f5e544544 100644 --- a/modules/fantasy.cpp +++ b/modules/fantasy.cpp @@ -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")); diff --git a/modules/m_httpd.cpp b/modules/m_httpd.cpp index b63b6685b..a3f2b0110 100644 --- a/modules/m_httpd.cpp +++ b/modules/m_httpd.cpp @@ -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; diff --git a/modules/m_xmlrpc.cpp b/modules/m_xmlrpc.cpp index 3ab028629..867ae217d 100644 --- a/modules/m_xmlrpc.cpp +++ b/modules/m_xmlrpc.cpp @@ -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::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); diff --git a/modules/pseudoclients/memoserv.cpp b/modules/pseudoclients/memoserv.cpp index 1d7e5d5bd..d4d00df64 100644 --- a/modules/pseudoclients/memoserv.cpp +++ b/modules/pseudoclients/memoserv.cpp @@ -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) diff --git a/modules/pseudoclients/nickserv.cpp b/modules/pseudoclients/nickserv.cpp index 73d9acf3d..013b067f9 100644 --- a/modules/pseudoclients/nickserv.cpp +++ b/modules/pseudoclients/nickserv.cpp @@ -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(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("hidenetsplitquit")) return; -- cgit From 6274bd0b34e51c3540f0dd467ab6a98567c502f6 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 27 Apr 2021 23:18:04 +0100 Subject: Use utf8mb4 instead of utf8 in chanstats and irc2sql. The utf8 charset, confusingly, is an alias for utf8mb3 which is not a real UTF-8 encoding as it can only store three byte characters. The real UTF-8 charset is utf8mb4. --- modules/extra/stats/irc2sql/tables.cpp | 18 +++++++++--------- modules/extra/stats/m_chanstats.cpp | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'modules') diff --git a/modules/extra/stats/irc2sql/tables.cpp b/modules/extra/stats/irc2sql/tables.cpp index 1c286a191..598dc49a7 100644 --- a/modules/extra/stats/irc2sql/tables.cpp +++ b/modules/extra/stats/irc2sql/tables.cpp @@ -34,7 +34,7 @@ void IRC2SQL::CheckTables() "`countryname` varchar(50)," "PRIMARY KEY `end` (`end`)," "KEY `start` (`start`)" - ") ENGINE=MyISAM DEFAULT CHARSET=utf8;"; + ") ENGINE=MyISAM 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=MyISAM 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=MyISAM 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=MyISAM 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=MyISAM 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=MyISAM 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=MyISAM 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=MyISAM 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=MyISAM DEFAULT CHARSET=utf8mb4;"; this->RunQuery(query); } if (this->HasProcedure(prefix + "UserConnect")) diff --git a/modules/extra/stats/m_chanstats.cpp b/modules/extra/stats/m_chanstats.cpp index 716c24310..a9c9bb8ae 100644 --- a/modules/extra/stats/m_chanstats.cpp +++ b/modules/extra/stats/m_chanstats.cpp @@ -317,7 +317,7 @@ class MChanstats : public Module "KEY `nick` (`nick`)," "KEY `chan_` (`chan`)," "KEY `type` (`type`)" - ") ENGINE=MyISAM DEFAULT CHARSET=utf8;"; + ") ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"; this->RunQuery(query); } /* There is no CREATE OR REPLACE PROCEDURE in MySQL */ -- cgit From a040f177874c8018f391defa17e8ec0a253c8f24 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 27 Apr 2021 23:21:07 +0100 Subject: Use InnoDB instead of the deprecated MyISAM engine. Ref: https://www.percona.com/blog/2016/10/11/mysql-8-0-end-myisam/ --- modules/extra/stats/irc2sql/tables.cpp | 18 +++++++++--------- modules/extra/stats/m_chanstats.cpp | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'modules') diff --git a/modules/extra/stats/irc2sql/tables.cpp b/modules/extra/stats/irc2sql/tables.cpp index 598dc49a7..28110fa9e 100644 --- a/modules/extra/stats/irc2sql/tables.cpp +++ b/modules/extra/stats/irc2sql/tables.cpp @@ -34,7 +34,7 @@ void IRC2SQL::CheckTables() "`countryname` varchar(50)," "PRIMARY KEY `end` (`end`)," "KEY `start` (`start`)" - ") ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"; + ") 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=utf8mb4;"; + ") 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=utf8mb4;"; + ") 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=utf8mb4;"; + ") 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=utf8mb4;"; + ") 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=utf8mb4;"; + ") 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=utf8mb4;"; + ") 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=utf8mb4;"; + ") 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=utf8mb4;"; + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"; this->RunQuery(query); } if (this->HasProcedure(prefix + "UserConnect")) diff --git a/modules/extra/stats/m_chanstats.cpp b/modules/extra/stats/m_chanstats.cpp index a9c9bb8ae..403174e6a 100644 --- a/modules/extra/stats/m_chanstats.cpp +++ b/modules/extra/stats/m_chanstats.cpp @@ -317,7 +317,7 @@ class MChanstats : public Module "KEY `nick` (`nick`)," "KEY `chan_` (`chan`)," "KEY `type` (`type`)" - ") ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"; + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"; this->RunQuery(query); } /* There is no CREATE OR REPLACE PROCEDURE in MySQL */ -- cgit From 3728a0bda1cf010520c4fae821fc9c98b2adb083 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 31 May 2021 20:53:29 +0100 Subject: Fix some misleading indentation in ns_register. --- modules/commands/ns_register.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'modules') diff --git a/modules/commands/ns_register.cpp b/modules/commands/ns_register.cpp index a4aa9f082..4ff4cca44 100644 --- a/modules/commands/ns_register.cpp +++ b/modules/commands/ns_register.cpp @@ -179,6 +179,7 @@ class CommandNSRegister : public Command } if (Config->GetModule("nickserv")->Get("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("passlen", "32"); -- cgit