From 7e990d1af81414b6b5147f561155d5919e1dd7ea Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Thu, 23 May 2013 20:12:09 +0200 Subject: Update authors --- src/commands/cmd_info.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/commands') diff --git a/src/commands/cmd_info.cpp b/src/commands/cmd_info.cpp index 63debd3fe..6e5f2a909 100644 --- a/src/commands/cmd_info.cpp +++ b/src/commands/cmd_info.cpp @@ -64,26 +64,27 @@ static const char* const lines[] = { " Matt Smith, dz, ", " Daniel De Graaf, danieldg, ", " jackmcbarn, ", + " Attila Molnar, Attila, ", " ", "\2Regular Contributors\2:", - " Majic MacGyver Namegduf Ankit", - " Phoenix Taros", + " Adam SaberUK", " ", "\2Other Contributors\2:", + " ChrisTX Shawn Shutter", + " ", + "\2Former Contributors\2:", " dmb Zaba skenmy GreenReaper", " Dan Jason satmd owine", " Adremelech John2 jilles HiroP", " eggy Bricker AnMaster djGrrr", " nenolod Quension praetorian pippijn", - " Adam", - " ", - "\2Former Contributors\2:", " CC jamie typobox43 Burlex (win32)", " Stskeeps ThaPrince BuildSmart Thunderhacker", - " Skip LeaChim", + " Skip LeaChim Majic MacGyver", + " Namegduf Ankit Phoenix Taros", " ", "\2Thanks To\2:", - " searchirc.com irc-junkie.org Brik", + " searchirc.com irc-junkie.org Brik fraggeln", " ", " Best experienced with: \2An IRC client\2", NULL -- cgit v1.2.3 From c8ef121681b73748bb78a2fdefca5d5973491f25 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Sat, 1 Jun 2013 20:53:45 +0200 Subject: cmd_who Hide +i users when listing users on a server and hidewhois is off Fixes #547 reported by @RawrDragon --- src/commands/cmd_who.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/commands') diff --git a/src/commands/cmd_who.cpp b/src/commands/cmd_who.cpp index c8cb67694..f8926b9f7 100644 --- a/src/commands/cmd_who.cpp +++ b/src/commands/cmd_who.cpp @@ -264,7 +264,7 @@ CmdResult CommandWho::Handle (const std::vector& parameters, User * for (const char* check = matchtext; *check; check++) { - if (*check == '*' || *check == '?') + if (*check == '*' || *check == '?' || *check == '.') { usingwildcards = true; break; -- cgit v1.2.3 From d87bfc277858543ff14cd43f4222c66362464094 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Wed, 5 Jun 2013 23:11:50 +0200 Subject: Remove unnecessary string copies and dead code --- src/commands/cmd_loadmodule.cpp | 2 +- src/modes/umode_o.cpp | 2 +- src/modules/extra/m_mysql.cpp | 1 - src/modules/m_cban.cpp | 2 +- src/modules/m_dccallow.cpp | 2 +- src/modules/m_passforward.cpp | 2 +- src/modules/m_rline.cpp | 5 ++--- src/modules/m_sasl.cpp | 4 ++-- src/modules/m_shun.cpp | 4 ++-- src/modules/m_spanningtree/main.cpp | 3 +-- src/modules/m_spanningtree/utils.cpp | 18 ++---------------- src/modules/m_spanningtree/utils.h | 15 ++------------- src/modules/m_svshold.cpp | 2 +- 13 files changed, 17 insertions(+), 45 deletions(-) (limited to 'src/commands') diff --git a/src/commands/cmd_loadmodule.cpp b/src/commands/cmd_loadmodule.cpp index 9d60613a2..379e597e4 100644 --- a/src/commands/cmd_loadmodule.cpp +++ b/src/commands/cmd_loadmodule.cpp @@ -44,7 +44,7 @@ class CommandLoadmodule : public Command */ CmdResult CommandLoadmodule::Handle (const std::vector& parameters, User *user) { - if (ServerInstance->Modules->Load(parameters[0].c_str())) + if (ServerInstance->Modules->Load(parameters[0])) { ServerInstance->SNO->WriteGlobalSno('a', "NEW MODULE: %s loaded %s",user->nick.c_str(), parameters[0].c_str()); user->WriteNumeric(975, "%s %s :Module successfully loaded.",user->nick.c_str(), parameters[0].c_str()); diff --git a/src/modes/umode_o.cpp b/src/modes/umode_o.cpp index 5fb62571d..a5f590ba0 100644 --- a/src/modes/umode_o.cpp +++ b/src/modes/umode_o.cpp @@ -32,7 +32,7 @@ ModeUserOperator::ModeUserOperator() : ModeHandler(NULL, "oper", 'o', PARAM_NONE ModeAction ModeUserOperator::OnModeChange(User* source, User* dest, Channel*, std::string&, bool adding) { /* Only opers can execute this class at all */ - if (!ServerInstance->ULine(source->nick.c_str()) && !ServerInstance->ULine(source->server) && !IS_OPER(source)) + if (!ServerInstance->ULine(source->server) && !IS_OPER(source)) return MODEACTION_DENY; /* Not even opers can GIVE the +o mode, only take it away */ diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index b2bb44408..22cf5f3f4 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -180,7 +180,6 @@ class MySQLresult : public SQLResult rows++; } mysql_free_result(res); - res = NULL; } } diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp index c779f02df..fb78e41b2 100644 --- a/src/modules/m_cban.cpp +++ b/src/modules/m_cban.cpp @@ -32,7 +32,7 @@ class CBan : public XLine public: irc::string matchtext; - CBan(time_t s_time, long d, std::string src, std::string re, std::string ch) + CBan(time_t s_time, long d, const std::string& src, const std::string& re, const std::string& ch) : XLine(s_time, d, src, re, "CBAN") { this->matchtext = ch.c_str(); diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index 712dd91b8..de7b6b7bf 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -166,7 +166,7 @@ class CommandDccallow : public Command length = ServerInstance->Duration(parameters[1]); } - if (!ServerInstance->IsValidMask(mask.c_str())) + if (!ServerInstance->IsValidMask(mask)) { return CMD_FAILURE; } diff --git a/src/modules/m_passforward.cpp b/src/modules/m_passforward.cpp index 84389fb22..c04b306b1 100644 --- a/src/modules/m_passforward.cpp +++ b/src/modules/m_passforward.cpp @@ -91,7 +91,7 @@ class ModulePassForward : public Module if (!nickrequired.empty()) { /* Check if nick exists and its server is ulined */ - User* u = ServerInstance->FindNick(nickrequired.c_str()); + User* u = ServerInstance->FindNick(nickrequired); if (!u || !ServerInstance->ULine(u->server)) return; } diff --git a/src/modules/m_rline.cpp b/src/modules/m_rline.cpp index 160092a63..d1ab5d9ba 100644 --- a/src/modules/m_rline.cpp +++ b/src/modules/m_rline.cpp @@ -41,11 +41,10 @@ class RLine : public XLine * @param regex Pattern to match with * @ */ - RLine(time_t s_time, long d, std::string src, std::string re, std::string regexs, dynamic_reference& rxfactory) + RLine(time_t s_time, long d, const std::string& src, const std::string& re, const std::string& regexs, dynamic_reference& rxfactory) : XLine(s_time, d, src, re, "R") + , matchtext(regexs) { - matchtext = regexs; - /* This can throw on failure, but if it does we DONT catch it here, we catch it and display it * where the object is created, we might not ALWAYS want it to output stuff to snomask x all the time */ diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index f8d8c5322..b67111987 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -52,7 +52,7 @@ class SaslAuthenticator bool state_announced; public: - SaslAuthenticator(User *user_, std::string method, Module *ctor) + SaslAuthenticator(User* user_, const std::string& method) : user(user_), state(SASL_INIT), state_announced(false) { parameterlist params; @@ -195,7 +195,7 @@ class CommandAuthenticate : public Command SaslAuthenticator *sasl = authExt.get(user); if (!sasl) - authExt.set(user, new SaslAuthenticator(user, parameters[0], creator)); + authExt.set(user, new SaslAuthenticator(user, parameters[0])); else if (sasl->SendClientMessage(parameters) == false) // IAL abort extension --nenolod { sasl->AnnounceState(); diff --git a/src/modules/m_shun.cpp b/src/modules/m_shun.cpp index 21959e400..8bf4d30e7 100644 --- a/src/modules/m_shun.cpp +++ b/src/modules/m_shun.cpp @@ -30,10 +30,10 @@ class Shun : public XLine public: std::string matchtext; - Shun(time_t s_time, long d, std::string src, std::string re, std::string shunmask) + Shun(time_t s_time, long d, const std::string& src, const std::string& re, const std::string& shunmask) : XLine(s_time, d, src, re, "SHUN") + , matchtext(shunmask) { - this->matchtext = shunmask; } ~Shun() diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 7e6ad12f8..7c93e7d45 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -271,8 +271,7 @@ void ModuleSpanningTree::ConnectServer(Link* x, Autoconnect* y) return; } - QueryType start_type = DNS_QUERY_A; - start_type = DNS_QUERY_AAAA; + QueryType start_type = DNS_QUERY_AAAA; if (strchr(x->IPAddr.c_str(),':')) { in6_addr n; diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp index cc1c400db..1879d7111 100644 --- a/src/modules/m_spanningtree/utils.cpp +++ b/src/modules/m_spanningtree/utils.cpp @@ -202,7 +202,7 @@ void SpanningTreeUtilities::GetListOfServersForChannel(Channel* c, TreeServerLis return; } -bool SpanningTreeUtilities::DoOneToAllButSender(const std::string &prefix, const std::string &command, const parameterlist ¶ms, std::string omit) +bool SpanningTreeUtilities::DoOneToAllButSender(const std::string &prefix, const std::string &command, const parameterlist ¶ms, const std::string& omit) { TreeServer* omitroute = this->BestRouteTo(omit); std::string FullLine = ":" + prefix + " " + command; @@ -251,21 +251,7 @@ bool SpanningTreeUtilities::DoOneToMany(const std::string &prefix, const std::st return true; } -bool SpanningTreeUtilities::DoOneToMany(const char* prefix, const char* command, const parameterlist ¶ms) -{ - std::string spfx = prefix; - std::string scmd = command; - return this->DoOneToMany(spfx, scmd, params); -} - -bool SpanningTreeUtilities::DoOneToAllButSender(const char* prefix, const char* command, const parameterlist ¶ms, std::string omit) -{ - std::string spfx = prefix; - std::string scmd = command; - return this->DoOneToAllButSender(spfx, scmd, params, omit); -} - -bool SpanningTreeUtilities::DoOneToOne(const std::string &prefix, const std::string &command, const parameterlist ¶ms, std::string target) +bool SpanningTreeUtilities::DoOneToOne(const std::string &prefix, const std::string &command, const parameterlist ¶ms, const std::string& target) { TreeServer* Route = this->BestRouteTo(target); if (Route) diff --git a/src/modules/m_spanningtree/utils.h b/src/modules/m_spanningtree/utils.h index 7d5ffa216..92a03428f 100644 --- a/src/modules/m_spanningtree/utils.h +++ b/src/modules/m_spanningtree/utils.h @@ -88,9 +88,6 @@ class SpanningTreeUtilities : public classbase /** Hash of currently known server ids */ server_hash sidlist; - /** Hash of servers currently bursting but not initialized as connected - */ - std::map burstingserverlist; /** List of all outgoing sockets and their timeouts */ std::map > timeoutlist; @@ -129,24 +126,16 @@ class SpanningTreeUtilities : public classbase /** Send a message from this server to one other local or remote */ - bool DoOneToOne(const std::string &prefix, const std::string &command, const parameterlist ¶ms, std::string target); - - /** Send a message from this server to all but one other, local or remote - */ - bool DoOneToAllButSender(const std::string &prefix, const std::string &command, const parameterlist ¶ms, std::string omit); + bool DoOneToOne(const std::string &prefix, const std::string &command, const parameterlist ¶ms, const std::string& target); /** Send a message from this server to all but one other, local or remote */ - bool DoOneToAllButSender(const char* prefix, const char* command, const parameterlist ¶ms, std::string omit); + bool DoOneToAllButSender(const std::string &prefix, const std::string &command, const parameterlist ¶ms, const std::string& omit); /** Send a message from this server to all others */ bool DoOneToMany(const std::string &prefix, const std::string &command, const parameterlist ¶ms); - /** Send a message from this server to all others - */ - bool DoOneToMany(const char* prefix, const char* command, const parameterlist ¶ms); - /** Read the spanningtree module's tags from the config file */ void ReadConfiguration(); diff --git a/src/modules/m_svshold.cpp b/src/modules/m_svshold.cpp index d2269839d..d8176043e 100644 --- a/src/modules/m_svshold.cpp +++ b/src/modules/m_svshold.cpp @@ -32,7 +32,7 @@ class SVSHold : public XLine public: irc::string nickname; - SVSHold(time_t s_time, long d, std::string src, std::string re, std::string nick) + SVSHold(time_t s_time, long d, const std::string& src, const std::string& re, const std::string& nick) : XLine(s_time, d, src, re, "SVSHOLD") { this->nickname = nick.c_str(); -- cgit v1.2.3