diff options
48 files changed, 87 insertions, 87 deletions
diff --git a/src/commands/cmd_die.cpp b/src/commands/cmd_die.cpp index a3cee5fad..9b0126e3e 100644 --- a/src/commands/cmd_die.cpp +++ b/src/commands/cmd_die.cpp @@ -49,7 +49,7 @@ CmdResult CommandDie::Handle (const std::vector<std::string>& parameters, User * if (!ServerInstance->PassCompare(user, ServerInstance->Config->diepass, parameters[0].c_str(), ServerInstance->Config->powerhash)) { { - std::string diebuf = std::string("*** DIE command from ") + user->nick + "!" + user->ident + "@" + user->dhost + ". Terminating."; + std::string diebuf = "*** DIE command from " + user->nick + "!" + user->ident + "@" + user->dhost + ". Terminating."; ServerInstance->Logs->Log("COMMAND",SPARSE, diebuf); ServerInstance->SendError(diebuf); } diff --git a/src/commands/cmd_ison.cpp b/src/commands/cmd_ison.cpp index 1a50239ee..227f1b3ed 100644 --- a/src/commands/cmd_ison.cpp +++ b/src/commands/cmd_ison.cpp @@ -48,7 +48,7 @@ CmdResult CommandIson::Handle (const std::vector<std::string>& parameters, User { std::map<User*,User*> ison_already; User *u; - std::string reply = std::string("303 ") + user->nick + " :"; + std::string reply = "303 " + user->nick + " :"; for (unsigned int i = 0; i < parameters.size(); i++) { @@ -62,7 +62,7 @@ CmdResult CommandIson::Handle (const std::vector<std::string>& parameters, User if (reply.length() > 450) { user->WriteServ(reply); - reply = std::string("303 ") + user->nick + " :"; + reply = "303 " + user->nick + " :"; } ison_already[u] = u; } @@ -87,7 +87,7 @@ CmdResult CommandIson::Handle (const std::vector<std::string>& parameters, User if (reply.length() > 450) { user->WriteServ(reply); - reply = std::string("303 ") + user->nick + " :"; + reply = "303 " + user->nick + " :"; } ison_already[u] = u; } diff --git a/src/commands/cmd_user.cpp b/src/commands/cmd_user.cpp index 57aecc2f7..305d0847f 100644 --- a/src/commands/cmd_user.cpp +++ b/src/commands/cmd_user.cpp @@ -62,7 +62,7 @@ CmdResult CommandUser::HandleLocal(const std::vector<std::string>& parameters, L * IDENTMAX here. */ user->ChangeIdent(parameters[0].c_str()); - user->fullname.assign(parameters[3].empty() ? std::string("No info") : parameters[3], 0, ServerInstance->Config->Limits.MaxGecos); + user->fullname.assign(parameters[3].empty() ? "No info" : parameters[3], 0, ServerInstance->Config->Limits.MaxGecos); user->registered = (user->registered | REG_USER); } } diff --git a/src/commands/cmd_userhost.cpp b/src/commands/cmd_userhost.cpp index af7d3ceca..399de0b1a 100644 --- a/src/commands/cmd_userhost.cpp +++ b/src/commands/cmd_userhost.cpp @@ -44,7 +44,7 @@ class CommandUserhost : public Command CmdResult CommandUserhost::Handle (const std::vector<std::string>& parameters, User *user) { - std::string retbuf = std::string("302 ") + user->nick + " :"; + std::string retbuf = "302 " + user->nick + " :"; for (unsigned int i = 0; i < parameters.size(); i++) { diff --git a/src/commands/cmd_who.cpp b/src/commands/cmd_who.cpp index c474abc3c..c8cb67694 100644 --- a/src/commands/cmd_who.cpp +++ b/src/commands/cmd_who.cpp @@ -251,7 +251,7 @@ CmdResult CommandWho::Handle (const std::vector<std::string>& parameters, User * Channel *ch = NULL; std::vector<std::string> whoresults; - std::string initial = "352 " + std::string(user->nick) + " "; + std::string initial = "352 " + user->nick + " "; char matchtext[MAXBUF]; bool usingwildcards = false; diff --git a/src/configreader.cpp b/src/configreader.cpp index 382bcaffb..c62f2446c 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -579,7 +579,7 @@ void ServerConfig::Fill() std::string modes = ConfValue("disabled")->getString("usermodes"); for (std::string::const_iterator p = modes.begin(); p != modes.end(); ++p) { - if (*p < 'A' || *p > ('A' + 64)) throw CoreException(std::string("Invalid usermode ")+(char)*p+" was found."); + if (*p < 'A' || *p > ('A' + 64)) throw CoreException("Invalid usermode " + std::string(1, *p) + " was found."); DisabledUModes[*p - 'A'] = 1; } @@ -587,7 +587,7 @@ void ServerConfig::Fill() modes = ConfValue("disabled")->getString("chanmodes"); for (std::string::const_iterator p = modes.begin(); p != modes.end(); ++p) { - if (*p < 'A' || *p > ('A' + 64)) throw CoreException(std::string("Invalid chanmode ")+(char)*p+" was found."); + if (*p < 'A' || *p > ('A' + 64)) throw CoreException("Invalid chanmode " + std::string(1, *p) + " was found."); DisabledCModes[*p - 'A'] = 1; } diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index 570e7d9ec..4173d654a 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -291,7 +291,7 @@ class SQLConnection : public SQLProvider { /* XXX: See /usr/include/mysql/mysqld_error.h for a list of * possible error numbers and error messages */ - SQLerror e(SQL_QREPLY_FAIL, ConvToStr(mysql_errno(connection)) + std::string(": ") + mysql_error(connection)); + SQLerror e(SQL_QREPLY_FAIL, ConvToStr(mysql_errno(connection)) + ": " + mysql_error(connection)); return new MySQLresult(e); } } diff --git a/src/modules/extra/m_regex_pcre.cpp b/src/modules/extra/m_regex_pcre.cpp index ca6bdfb95..ebd2213b2 100644 --- a/src/modules/extra/m_regex_pcre.cpp +++ b/src/modules/extra/m_regex_pcre.cpp @@ -35,7 +35,7 @@ class PCREException : public ModuleException { public: PCREException(const std::string& rx, const std::string& error, int erroffset) - : ModuleException(std::string("Error in regex ") + rx + " at offset " + ConvToStr(erroffset) + ": " + error) + : ModuleException("Error in regex " + rx + " at offset " + ConvToStr(erroffset) + ": " + error) { } }; diff --git a/src/modules/extra/m_regex_posix.cpp b/src/modules/extra/m_regex_posix.cpp index 4cb1a03d5..6e837bcb6 100644 --- a/src/modules/extra/m_regex_posix.cpp +++ b/src/modules/extra/m_regex_posix.cpp @@ -30,7 +30,7 @@ class POSIXRegexException : public ModuleException { public: POSIXRegexException(const std::string& rx, const std::string& error) - : ModuleException(std::string("Error in regex ") + rx + ": " + error) + : ModuleException("Error in regex " + rx + ": " + error) { } }; diff --git a/src/modules/extra/m_regex_tre.cpp b/src/modules/extra/m_regex_tre.cpp index 9693d1258..4b9eab472 100644 --- a/src/modules/extra/m_regex_tre.cpp +++ b/src/modules/extra/m_regex_tre.cpp @@ -32,7 +32,7 @@ class TRERegexException : public ModuleException { public: TRERegexException(const std::string& rx, const std::string& error) - : ModuleException(std::string("Error in regex ") + rx + ": " + error) + : ModuleException("Error in regex " + rx + ": " + error) { } }; diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 06daf763e..6616295b9 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -627,7 +627,7 @@ class ModuleSSLGnuTLS : public Module } else { - user->SetError(std::string("Handshake Failed - ") + gnutls_strerror(ret)); + user->SetError("Handshake Failed - " + std::string(gnutls_strerror(ret))); CloseSession(session); session->status = ISSL_CLOSING; } diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index 6cb336c83..686938eb4 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -281,7 +281,7 @@ class ModuleAlias : public Module u = ServerInstance->FindNick(a->RequiredNick); if (!u) { - user->WriteNumeric(401, ""+std::string(user->nick)+" "+a->RequiredNick+" :is currently unavailable. Please try again later."); + user->WriteNumeric(401, ""+user->nick+" "+a->RequiredNick+" :is currently unavailable. Please try again later."); return 1; } } @@ -290,7 +290,7 @@ class ModuleAlias : public Module if (!ServerInstance->ULine(u->server)) { ServerInstance->SNO->WriteToSnoMask('a', "NOTICE -- Service "+a->RequiredNick+" required by alias "+std::string(a->AliasedCommand.c_str())+" is not on a u-lined server, possibly underhanded antics detected!"); - user->WriteNumeric(401, ""+std::string(user->nick)+" "+a->RequiredNick+" :is an imposter! Please inform an IRC operator as soon as possible."); + user->WriteNumeric(401, ""+user->nick+" "+a->RequiredNick+" :is an imposter! Please inform an IRC operator as soon as possible."); return 1; } } diff --git a/src/modules/m_botmode.cpp b/src/modules/m_botmode.cpp index 5871b9227..23094ddc5 100644 --- a/src/modules/m_botmode.cpp +++ b/src/modules/m_botmode.cpp @@ -58,7 +58,7 @@ class ModuleBotMode : public Module { if (dst->IsModeSet('B')) { - ServerInstance->SendWhoisLine(src, dst, 335, std::string(src->nick)+" "+std::string(dst->nick)+" :is a bot on "+ServerInstance->Config->Network); + ServerInstance->SendWhoisLine(src, dst, 335, src->nick+" "+dst->nick+" :is a bot on "+ServerInstance->Config->Network); } } diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index 099661de7..994745422 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -68,7 +68,7 @@ class CommandCheck : public Command std::string checkstr; std::string chliststr; - checkstr = std::string(":") + ServerInstance->Config->ServerName + " 304 " + std::string(user->nick) + " :CHECK"; + checkstr = ":" + ServerInstance->Config->ServerName + " 304 " + user->nick + " :CHECK"; targuser = ServerInstance->FindNick(parameters[0]); targchan = ServerInstance->FindChan(parameters[0]); diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index c5f9e5da5..6991814f6 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -51,7 +51,7 @@ class CommandChghost : public Command { if (!hostmap[(unsigned char)*x]) { - user->WriteServ("NOTICE "+std::string(user->nick)+" :*** CHGHOST: Invalid characters in hostname"); + user->WriteServ("NOTICE "+user->nick+" :*** CHGHOST: Invalid characters in hostname"); return CMD_FAILURE; } } @@ -69,7 +69,7 @@ class CommandChghost : public Command if ((dest->ChangeDisplayedHost(parameters[1].c_str())) && (!ServerInstance->ULine(user->server))) { // fix by brain - ulines set hosts silently - ServerInstance->SNO->WriteGlobalSno('a', std::string(user->nick)+" used CHGHOST to make the displayed host of "+dest->nick+" become "+dest->dhost); + ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used CHGHOST to make the displayed host of "+dest->nick+" become "+dest->dhost); } } diff --git a/src/modules/m_clones.cpp b/src/modules/m_clones.cpp index aceac0dc7..9c2b2cfa7 100644 --- a/src/modules/m_clones.cpp +++ b/src/modules/m_clones.cpp @@ -36,7 +36,7 @@ class CommandClones : public Command CmdResult Handle (const std::vector<std::string> ¶meters, User *user) { - std::string clonesstr = "304 " + std::string(user->nick) + " :CLONES"; + std::string clonesstr = "304 " + user->nick + " :CLONES"; unsigned long limit = atoi(parameters[0].c_str()); diff --git a/src/modules/m_cycle.cpp b/src/modules/m_cycle.cpp index 1eb3c1899..10b593fdd 100644 --- a/src/modules/m_cycle.cpp +++ b/src/modules/m_cycle.cpp @@ -60,7 +60,7 @@ class CommandCycle : public Command if (channel->GetPrefixValue(user) < VOICE_VALUE && channel->IsBanned(user)) { /* banned, boned. drop the message. */ - user->WriteServ("NOTICE "+std::string(user->nick)+" :*** You may not cycle, as you are banned on channel " + channel->name); + user->WriteServ("NOTICE "+user->nick+" :*** You may not cycle, as you are banned on channel " + channel->name); return CMD_FAILURE; } diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index 0cea96154..10b1b98ac 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -149,7 +149,7 @@ class CommandDccallow : public Command } } - std::string mask = std::string(target->nick)+"!"+std::string(target->ident)+"@"+std::string(target->dhost); + std::string mask = target->nick+"!"+target->ident+"@"+target->dhost; ConfigReader Conf; std::string default_length = Conf.ReadValue("dccallow", "length", 0); diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index 52500dec8..aacd17496 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -116,7 +116,7 @@ class DNSBLResolver : public Resolver { case DNSBLConfEntry::I_KILL: { - ServerInstance->Users->QuitUser(them, std::string("Killed (") + reason + ")"); + ServerInstance->Users->QuitUser(them, "Killed (" + reason + ")"); break; } case DNSBLConfEntry::I_MARK: diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp index d2cffdb5d..9e06ca494 100644 --- a/src/modules/m_filter.cpp +++ b/src/modules/m_filter.cpp @@ -178,7 +178,7 @@ CmdResult CommandFilter::Handle(const std::vector<std::string> ¶meters, User if (static_cast<ModuleFilter *>(me)->DeleteFilter(parameters[0])) { user->WriteServ("NOTICE %s :*** Removed filter '%s'", user->nick.c_str(), parameters[0].c_str()); - ServerInstance->SNO->WriteToSnoMask(IS_LOCAL(user) ? 'a' : 'A', std::string("FILTER: ")+user->nick+" removed filter '"+parameters[0]+"'"); + ServerInstance->SNO->WriteToSnoMask(IS_LOCAL(user) ? 'a' : 'A', "FILTER: "+user->nick+" removed filter '"+parameters[0]+"'"); return CMD_SUCCESS; } else @@ -231,7 +231,7 @@ CmdResult CommandFilter::Handle(const std::vector<std::string> ¶meters, User type.c_str(), (duration ? ", duration " : ""), (duration ? parameters[3].c_str() : ""), flags.c_str(), reason.c_str()); - ServerInstance->SNO->WriteToSnoMask(IS_LOCAL(user) ? 'a' : 'A', std::string("FILTER: ")+user->nick+" added filter '"+freeform+"', type '"+type+"', "+(duration ? "duration "+parameters[3]+", " : "")+"flags '"+flags+"', reason: "+reason); + ServerInstance->SNO->WriteToSnoMask(IS_LOCAL(user) ? 'a' : 'A', "FILTER: "+user->nick+" added filter '"+freeform+"', type '"+type+"', "+(duration ? "duration "+parameters[3]+", " : "")+"flags '"+flags+"', reason: "+reason); return CMD_SUCCESS; } @@ -306,7 +306,7 @@ ModResult ModuleFilter::OnUserPreNotice(User* user,void* dest,int target_type, s if (target_type == TYPE_USER) { User* t = (User*)dest; - target = std::string(t->nick); + target = t->nick; } else if (target_type == TYPE_CHANNEL) { @@ -317,18 +317,18 @@ ModResult ModuleFilter::OnUserPreNotice(User* user,void* dest,int target_type, s } if (f->action == "block") { - ServerInstance->SNO->WriteGlobalSno('a', std::string("FILTER: ")+user->nick+" had their message filtered, target was "+target+": "+f->reason); + ServerInstance->SNO->WriteGlobalSno('a', "FILTER: "+user->nick+" had their message filtered, target was "+target+": "+f->reason); if (target_type == TYPE_CHANNEL) user->WriteNumeric(404, "%s %s :Message to channel blocked and opers notified (%s)",user->nick.c_str(), target.c_str(), f->reason.c_str()); else - user->WriteServ("NOTICE "+std::string(user->nick)+" :Your message to "+target+" was blocked and opers notified: "+f->reason); + user->WriteServ("NOTICE "+user->nick+" :Your message to "+target+" was blocked and opers notified: "+f->reason); } if (f->action == "silent") { if (target_type == TYPE_CHANNEL) user->WriteNumeric(404, "%s %s :Message to channel blocked (%s)",user->nick.c_str(), target.c_str(), f->reason.c_str()); else - user->WriteServ("NOTICE "+std::string(user->nick)+" :Your message to "+target+" was blocked: "+f->reason); + user->WriteServ("NOTICE "+user->nick+" :Your message to "+target+" was blocked: "+f->reason); } if (f->action == "kill") { diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp index 60c23f45b..8080599e7 100644 --- a/src/modules/m_helpop.cpp +++ b/src/modules/m_helpop.cpp @@ -160,7 +160,7 @@ class ModuleHelpop : public Module { if (dst->IsModeSet('h')) { - ServerInstance->SendWhoisLine(src, dst, 310, std::string(src->nick)+" "+std::string(dst->nick)+" :is available for help."); + ServerInstance->SendWhoisLine(src, dst, 310, src->nick+" "+dst->nick+" :is available for help."); } } diff --git a/src/modules/m_hostchange.cpp b/src/modules/m_hostchange.cpp index e63c61631..099050a27 100644 --- a/src/modules/m_hostchange.cpp +++ b/src/modules/m_hostchange.cpp @@ -160,9 +160,9 @@ class ModuleHostChange : public Module } if (!newhost.empty()) { - user->WriteServ("NOTICE "+std::string(user->nick)+" :Setting your virtual host: " + newhost); + user->WriteServ("NOTICE "+user->nick+" :Setting your virtual host: " + newhost); if (!user->ChangeDisplayedHost(newhost.c_str())) - user->WriteServ("NOTICE "+std::string(user->nick)+" :Could not set your virtual host: " + newhost); + user->WriteServ("NOTICE "+user->nick+" :Could not set your virtual host: " + newhost); return; } } diff --git a/src/modules/m_ojoin.cpp b/src/modules/m_ojoin.cpp index d4daf2b63..fcb267750 100644 --- a/src/modules/m_ojoin.cpp +++ b/src/modules/m_ojoin.cpp @@ -61,7 +61,7 @@ class CommandOjoin : public Command // Make sure the channel name is allowable. if (!ServerInstance->IsChannel(parameters[0].c_str(), ServerInstance->Config->Limits.ChanMax)) { - user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Invalid characters in channel name or name too long"); + user->WriteServ("NOTICE "+user->nick+" :*** Invalid characters in channel name or name too long"); return CMD_FAILURE; } @@ -71,19 +71,19 @@ class CommandOjoin : public Command if (channel) { - ServerInstance->SNO->WriteGlobalSno('a', std::string(user->nick)+" used OJOIN to join "+channel->name); + ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used OJOIN to join "+channel->name); if (notice) { channel = ServerInstance->FindChan(parameters[0]); channel->WriteChannelWithServ(ServerInstance->Config->ServerName.c_str(), "NOTICE %s :%s joined on official network business.", parameters[0].c_str(), user->nick.c_str()); - ServerInstance->PI->SendChannelNotice(channel, 0, std::string(user->nick) + " joined on official network business."); + ServerInstance->PI->SendChannelNotice(channel, 0, user->nick + " joined on official network business."); } } else { - ServerInstance->SNO->WriteGlobalSno('a', std::string(user->nick)+" used OJOIN in "+parameters[0]); + ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used OJOIN in "+parameters[0]); // they're already in the channel std::vector<std::string> modes; modes.push_back(parameters[0]); diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp index c946193a8..bbd1c4e51 100644 --- a/src/modules/m_override.cpp +++ b/src/modules/m_override.cpp @@ -74,7 +74,7 @@ class ModuleOverride : public Module { if (!channel->HasUser(source) || (channel->IsModeSet('t') && channel->GetPrefixValue(source) < HALFOP_VALUE)) { - ServerInstance->SNO->WriteGlobalSno('v',std::string(source->nick)+" used oper override to change a topic on "+std::string(channel->name)); + ServerInstance->SNO->WriteGlobalSno('v',source->nick+" used oper override to change a topic on "+channel->name); } // Explicit allow @@ -91,7 +91,7 @@ class ModuleOverride : public Module // If the kicker's status is less than the target's, or the kicker's status is less than or equal to voice if ((memb->chan->GetPrefixValue(source) < memb->getRank()) || (memb->chan->GetPrefixValue(source) <= VOICE_VALUE)) { - ServerInstance->SNO->WriteGlobalSno('v',std::string(source->nick)+" used oper override to kick "+std::string(memb->user->nick)+" on "+std::string(memb->chan->name)+" ("+reason+")"); + ServerInstance->SNO->WriteGlobalSno('v',source->nick+" used oper override to kick "+memb->user->nick+" on "+memb->chan->name+" ("+reason+")"); return MOD_RES_ALLOW; } } @@ -109,7 +109,7 @@ class ModuleOverride : public Module if (mode < HALFOP_VALUE && CanOverride(source, "MODE")) { - std::string msg = std::string(source->nick)+" overriding modes:"; + std::string msg = source->nick+" overriding modes:"; for(unsigned int i=0; i < parameters.size(); i++) msg += " " + parameters[i]; ServerInstance->SNO->WriteGlobalSno('v',msg); diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp index b84a906eb..454780d03 100644 --- a/src/modules/m_remove.cpp +++ b/src/modules/m_remove.cpp @@ -117,7 +117,7 @@ class RemoveBase : public Command } /* Build up the part reason string. */ - reason = std::string("Removed by ") + user->nick + ": " + reasonparam; + reason = "Removed by " + user->nick + ": " + reasonparam; channel->WriteChannelWithServ(ServerInstance->Config->ServerName.c_str(), "NOTICE %s :%s removed %s from the channel", channel->name.c_str(), user->nick.c_str(), target->nick.c_str()); target->WriteServ("NOTICE %s :*** %s removed you from %s with the message: %s", target->nick.c_str(), user->nick.c_str(), channel->name.c_str(), reasonparam.c_str()); diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp index 46732b6a6..df88cd8f7 100644 --- a/src/modules/m_sajoin.cpp +++ b/src/modules/m_sajoin.cpp @@ -47,7 +47,7 @@ class CommandSajoin : public Command if (IS_LOCAL(user) && !ServerInstance->IsChannel(parameters[1].c_str(), ServerInstance->Config->Limits.ChanMax)) { /* we didn't need to check this for each character ;) */ - user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Invalid characters in channel name or name too long"); + user->WriteServ("NOTICE "+user->nick+" :*** Invalid characters in channel name or name too long"); return CMD_FAILURE; } @@ -64,30 +64,30 @@ class CommandSajoin : public Command { if (n->HasUser(dest)) { - ServerInstance->SNO->WriteToSnoMask('a', std::string(user->nick)+" used SAJOIN to make "+std::string(dest->nick)+" join "+parameters[1]); + ServerInstance->SNO->WriteToSnoMask('a', user->nick+" used SAJOIN to make "+dest->nick+" join "+parameters[1]); return CMD_SUCCESS; } else { - user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Could not join "+std::string(dest->nick)+" to "+parameters[1]+" (User is probably banned, or blocking modes)"); + user->WriteServ("NOTICE "+user->nick+" :*** Could not join "+dest->nick+" to "+parameters[1]+" (User is probably banned, or blocking modes)"); return CMD_FAILURE; } } else { - user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Could not join "+std::string(dest->nick)+" to "+parameters[1]); + user->WriteServ("NOTICE "+user->nick+" :*** Could not join "+dest->nick+" to "+parameters[1]); return CMD_FAILURE; } } else { - ServerInstance->SNO->WriteToSnoMask('a', std::string(user->nick)+" sent remote SAJOIN to make "+std::string(dest->nick)+" join "+parameters[1]); + ServerInstance->SNO->WriteToSnoMask('a', user->nick+" sent remote SAJOIN to make "+dest->nick+" join "+parameters[1]); return CMD_SUCCESS; } } else { - user->WriteServ("NOTICE "+std::string(user->nick)+" :*** No such nickname "+parameters[0]); + user->WriteServ("NOTICE "+user->nick+" :*** No such nickname "+parameters[0]); return CMD_FAILURE; } } diff --git a/src/modules/m_sakick.cpp b/src/modules/m_sakick.cpp index 2cb1f2a04..3926a18e6 100644 --- a/src/modules/m_sakick.cpp +++ b/src/modules/m_sakick.cpp @@ -76,7 +76,7 @@ class CommandSakick : public Command if (IS_LOCAL(user)) { /* Locally issued command; send the snomasks */ - ServerInstance->SNO->WriteGlobalSno('a', std::string(user->nick) + " SAKICKed " + dest->nick + " on " + parameters[0]); + ServerInstance->SNO->WriteGlobalSno('a', user->nick + " SAKICKed " + dest->nick + " on " + parameters[0]); } return CMD_SUCCESS; diff --git a/src/modules/m_samode.cpp b/src/modules/m_samode.cpp index d9c75adf7..2b5ec1bd8 100644 --- a/src/modules/m_samode.cpp +++ b/src/modules/m_samode.cpp @@ -41,7 +41,7 @@ class CommandSamode : public Command this->active = true; ServerInstance->Parser->CallHandler("MODE", parameters, user); if (ServerInstance->Modes->GetLastParse().length()) - ServerInstance->SNO->WriteGlobalSno('a', std::string(user->nick) + " used SAMODE: " +ServerInstance->Modes->GetLastParse()); + ServerInstance->SNO->WriteGlobalSno('a', user->nick + " used SAMODE: " +ServerInstance->Modes->GetLastParse()); this->active = false; return CMD_SUCCESS; } diff --git a/src/modules/m_sapart.cpp b/src/modules/m_sapart.cpp index c1e6f6c08..8845cd58e 100644 --- a/src/modules/m_sapart.cpp +++ b/src/modules/m_sapart.cpp @@ -62,14 +62,14 @@ class CommandSapart : public Command Channel* n = ServerInstance->FindChan(parameters[1]); if (!n) { - ServerInstance->SNO->WriteGlobalSno('a', std::string(user->nick)+" used SAPART to make "+dest->nick+" part "+parameters[1]); + ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used SAPART to make "+dest->nick+" part "+parameters[1]); return CMD_SUCCESS; } else { if (!n->HasUser(dest)) { - ServerInstance->SNO->WriteGlobalSno('a', std::string(user->nick)+" used SAPART to make "+dest->nick+" part "+parameters[1]); + ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used SAPART to make "+dest->nick+" part "+parameters[1]); return CMD_SUCCESS; } else diff --git a/src/modules/m_saquit.cpp b/src/modules/m_saquit.cpp index eae832ccb..46f047550 100644 --- a/src/modules/m_saquit.cpp +++ b/src/modules/m_saquit.cpp @@ -49,7 +49,7 @@ class CommandSaquit : public Command if (!IS_LOCAL(dest)) return CMD_SUCCESS; - ServerInstance->SNO->WriteGlobalSno('a', std::string(user->nick)+" used SAQUIT to make "+std::string(dest->nick)+" quit with a reason of "+parameters[1]); + ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used SAQUIT to make "+dest->nick+" quit with a reason of "+parameters[1]); ServerInstance->Users->QuitUser(dest, parameters[1]); return CMD_SUCCESS; diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp index cc941d905..635dc284b 100644 --- a/src/modules/m_services_account.cpp +++ b/src/modules/m_services_account.cpp @@ -189,7 +189,7 @@ class ModuleServicesAccount : public Module if (c->IsModeSet('M') && !is_registered && res != MOD_RES_ALLOW) { // user messaging a +M channel and is not registered - user->WriteNumeric(477, ""+std::string(user->nick)+" "+std::string(c->name)+" :You need to be identified to a registered account to message this channel"); + user->WriteNumeric(477, user->nick+" "+c->name+" :You need to be identified to a registered account to message this channel"); return MOD_RES_DENY; } } diff --git a/src/modules/m_servprotect.cpp b/src/modules/m_servprotect.cpp index c98eebec3..797c541eb 100644 --- a/src/modules/m_servprotect.cpp +++ b/src/modules/m_servprotect.cpp @@ -71,7 +71,7 @@ class ModuleServProtectMode : public Module { if (dst->IsModeSet('k')) { - ServerInstance->SendWhoisLine(src, dst, 310, std::string(src->nick)+" "+std::string(dst->nick)+" :is an "+ServerInstance->Config->Network+" Service"); + ServerInstance->SendWhoisLine(src, dst, 310, src->nick+" "+dst->nick+" :is an "+ServerInstance->Config->Network+" Service"); } } @@ -112,7 +112,7 @@ class ModuleServProtectMode : public Module if (dst->IsModeSet('k')) { src->WriteNumeric(485, "%s :You are not permitted to kill %s services!", src->nick.c_str(), ServerInstance->Config->Network.c_str()); - ServerInstance->SNO->WriteGlobalSno('a', std::string(src->nick)+" tried to kill service "+dst->nick+" ("+reason+")"); + ServerInstance->SNO->WriteGlobalSno('a', src->nick+" tried to kill service "+dst->nick+" ("+reason+")"); return MOD_RES_DENY; } return MOD_RES_PASSTHRU; diff --git a/src/modules/m_sethost.cpp b/src/modules/m_sethost.cpp index 8bab2c3b4..ae0cc7c56 100644 --- a/src/modules/m_sethost.cpp +++ b/src/modules/m_sethost.cpp @@ -43,7 +43,7 @@ class CommandSethost : public Command { if (!hostmap[(const unsigned char)*x]) { - user->WriteServ("NOTICE "+std::string(user->nick)+" :*** SETHOST: Invalid characters in hostname"); + user->WriteServ("NOTICE "+user->nick+" :*** SETHOST: Invalid characters in hostname"); return CMD_FAILURE; } } @@ -60,7 +60,7 @@ class CommandSethost : public Command if (user->ChangeDisplayedHost(parameters[0].c_str())) { - ServerInstance->SNO->WriteGlobalSno('a', std::string(user->nick)+" used SETHOST to change their displayed host to "+user->dhost); + ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used SETHOST to change their displayed host to "+user->dhost); return CMD_SUCCESS; } diff --git a/src/modules/m_setidle.cpp b/src/modules/m_setidle.cpp index e3733957d..97008797c 100644 --- a/src/modules/m_setidle.cpp +++ b/src/modules/m_setidle.cpp @@ -46,7 +46,7 @@ class CommandSetidle : public Command // minor tweak - we cant have signon time shorter than our idle time! if (user->signon > user->idle_lastmsg) user->signon = user->idle_lastmsg; - ServerInstance->SNO->WriteToSnoMask('a', std::string(user->nick)+" used SETIDLE to set their idle time to "+ConvToStr(idle)+" seconds"); + ServerInstance->SNO->WriteToSnoMask('a', user->nick+" used SETIDLE to set their idle time to "+ConvToStr(idle)+" seconds"); user->WriteNumeric(944, "%s :Idle time set.",user->nick.c_str()); return CMD_SUCCESS; diff --git a/src/modules/m_spanningtree/capab.cpp b/src/modules/m_spanningtree/capab.cpp index 40769df3d..62afe5974 100644 --- a/src/modules/m_spanningtree/capab.cpp +++ b/src/modules/m_spanningtree/capab.cpp @@ -321,7 +321,7 @@ bool TreeSocket::Capab(const parameterlist ¶ms) if (!this->GetTheirChallenge().empty() && (this->LinkState == CONNECTING)) { this->SendCapabilities(2); - this->WriteLine(std::string("SERVER ")+ServerInstance->Config->ServerName+" "+this->MakePass(capab->link->SendPass, capab->theirchallenge)+" 0 "+ServerInstance->Config->GetSID()+" :"+ServerInstance->Config->ServerDesc); + this->WriteLine("SERVER "+ServerInstance->Config->ServerName+" "+this->MakePass(capab->link->SendPass, capab->theirchallenge)+" 0 "+ServerInstance->Config->GetSID()+" :"+ServerInstance->Config->ServerDesc); } } else @@ -330,7 +330,7 @@ bool TreeSocket::Capab(const parameterlist ¶ms) if (this->LinkState == CONNECTING) { this->SendCapabilities(2); - this->WriteLine(std::string("SERVER ")+ServerInstance->Config->ServerName+" "+capab->link->SendPass+" 0 "+ServerInstance->Config->GetSID()+" :"+ServerInstance->Config->ServerDesc); + this->WriteLine("SERVER "+ServerInstance->Config->ServerName+" "+capab->link->SendPass+" 0 "+ServerInstance->Config->GetSID()+" :"+ServerInstance->Config->ServerDesc); } } diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 013bbce88..761343bb1 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -145,9 +145,9 @@ std::string ModuleSpanningTree::TimeToStr(time_t secs) secs = secs % 60; mins_up = mins_up % 60; hours_up = hours_up % 24; - return ((days_up ? (ConvToStr(days_up) + "d") : std::string("")) - + (hours_up ? (ConvToStr(hours_up) + "h") : std::string("")) - + (mins_up ? (ConvToStr(mins_up) + "m") : std::string("")) + return ((days_up ? (ConvToStr(days_up) + "d") : "") + + (hours_up ? (ConvToStr(hours_up) + "h") : "") + + (mins_up ? (ConvToStr(mins_up) + "m") : "") + ConvToStr(secs) + "s"); } @@ -194,7 +194,7 @@ restart: // ... if we can find a proper route to them if (tsock) { - tsock->WriteLine(std::string(":") + ServerInstance->Config->GetSID() + " PING " + + tsock->WriteLine(":" + ServerInstance->Config->GetSID() + " PING " + ServerInstance->Config->GetSID() + " " + s->GetID()); s->LastPingMsec = ts; } @@ -592,7 +592,7 @@ void ModuleSpanningTree::OnUserConnect(LocalUser* user) params.push_back(user->GetIPString()); params.push_back(ConvToStr(user->signon)); params.push_back("+"+std::string(user->FormatModes(true))); - params.push_back(":"+std::string(user->fullname)); + params.push_back(":"+user->fullname); Utils->DoOneToMany(ServerInstance->Config->GetSID(), "UID", params); if (IS_OPER(user)) @@ -625,7 +625,7 @@ void ModuleSpanningTree::OnUserJoin(Membership* memb, bool sync, bool created, C params.push_back(memb->chan->name); params.push_back(ConvToStr(memb->chan->age)); params.push_back(std::string("+") + memb->chan->ChanModes(true)); - params.push_back(memb->modes+","+std::string(memb->user->uuid)); + params.push_back(memb->modes+","+memb->user->uuid); Utils->DoOneToMany(ServerInstance->Config->GetSID(),"FJOIN",params); } } @@ -929,12 +929,12 @@ void ModuleSpanningTree::ProtoSendMode(void* opaque, TargetTypeFlags target_type if (target_type == TYPE_USER) { User* u = (User*)target; - s->WriteLine(std::string(":")+ServerInstance->Config->GetSID()+" MODE "+u->uuid+" "+output_text); + s->WriteLine(":"+ServerInstance->Config->GetSID()+" MODE "+u->uuid+" "+output_text); } else if (target_type == TYPE_CHANNEL) { Channel* c = (Channel*)target; - s->WriteLine(std::string(":")+ServerInstance->Config->GetSID()+" FMODE "+c->name+" "+ConvToStr(c->age)+" "+output_text); + s->WriteLine(":"+ServerInstance->Config->GetSID()+" FMODE "+c->name+" "+ConvToStr(c->age)+" "+output_text); } } } @@ -945,11 +945,11 @@ void ModuleSpanningTree::ProtoSendMetaData(void* opaque, Extensible* target, con User* u = dynamic_cast<User*>(target); Channel* c = dynamic_cast<Channel*>(target); if (u) - s->WriteLine(std::string(":")+ServerInstance->Config->GetSID()+" METADATA "+u->uuid+" "+extname+" :"+extdata); + s->WriteLine(":"+ServerInstance->Config->GetSID()+" METADATA "+u->uuid+" "+extname+" :"+extdata); else if (c) - s->WriteLine(std::string(":")+ServerInstance->Config->GetSID()+" METADATA "+c->name+" "+extname+" :"+extdata); + s->WriteLine(":"+ServerInstance->Config->GetSID()+" METADATA "+c->name+" "+extname+" :"+extdata); else if (!target) - s->WriteLine(std::string(":")+ServerInstance->Config->GetSID()+" METADATA * "+extname+" :"+extdata); + s->WriteLine(":"+ServerInstance->Config->GetSID()+" METADATA * "+extname+" :"+extdata); } CullResult ModuleSpanningTree::cull() diff --git a/src/modules/m_spanningtree/nickcollide.cpp b/src/modules/m_spanningtree/nickcollide.cpp index 5cb4344bf..38d59affb 100644 --- a/src/modules/m_spanningtree/nickcollide.cpp +++ b/src/modules/m_spanningtree/nickcollide.cpp @@ -127,7 +127,7 @@ int TreeSocket::DoCollision(User *u, time_t remotets, const std::string &remotei * the UID or halt the propagation of the nick change command, * so other servers don't need to see the SAVE */ - WriteLine(std::string(":")+ServerInstance->Config->GetSID()+" SAVE "+remoteuid+" "+ ConvToStr(remotets)); + WriteLine(":"+ServerInstance->Config->GetSID()+" SAVE "+remoteuid+" "+ ConvToStr(remotets)); if (remote) { diff --git a/src/modules/m_spanningtree/override_squit.cpp b/src/modules/m_spanningtree/override_squit.cpp index 2a95acb40..7d01c8149 100644 --- a/src/modules/m_spanningtree/override_squit.cpp +++ b/src/modules/m_spanningtree/override_squit.cpp @@ -46,7 +46,7 @@ ModResult ModuleSpanningTree::HandleSquit(const std::vector<std::string>& parame if (sock) { ServerInstance->SNO->WriteToSnoMask('l',"SQUIT: Server \002%s\002 removed from network by %s",parameters[0].c_str(),user->nick.c_str()); - sock->Squit(s,std::string("Server quit by ") + user->GetFullRealHost()); + sock->Squit(s,"Server quit by " + user->GetFullRealHost()); ServerInstance->SE->DelFd(sock); sock->Close(); } diff --git a/src/modules/m_spanningtree/ping.cpp b/src/modules/m_spanningtree/ping.cpp index 97cc44b6f..aec680b23 100644 --- a/src/modules/m_spanningtree/ping.cpp +++ b/src/modules/m_spanningtree/ping.cpp @@ -36,7 +36,7 @@ bool TreeSocket::LocalPing(const std::string &prefix, parameterlist ¶ms) if (params.size() == 1) { std::string stufftobounce = params[0]; - this->WriteLine(std::string(":")+ServerInstance->Config->GetSID()+" PONG "+stufftobounce); + this->WriteLine(":"+ServerInstance->Config->GetSID()+" PONG "+stufftobounce); return true; } else diff --git a/src/modules/m_spanningtree/rsquit.cpp b/src/modules/m_spanningtree/rsquit.cpp index e3ca22289..027ae02ab 100644 --- a/src/modules/m_spanningtree/rsquit.cpp +++ b/src/modules/m_spanningtree/rsquit.cpp @@ -63,7 +63,7 @@ CmdResult CommandRSQuit::Handle (const std::vector<std::string>& parameters, Use { const char *reason = parameters.size() == 2 ? parameters[1].c_str() : "No reason"; ServerInstance->SNO->WriteToSnoMask('l',"RSQUIT: Server \002%s\002 removed from network by %s (%s)", parameters[0].c_str(), user->nick.c_str(), reason); - sock->Squit(server_target, std::string("Server quit by ") + user->GetFullRealHost() + " (" + reason + ")"); + sock->Squit(server_target, "Server quit by " + user->GetFullRealHost() + " (" + reason + ")"); sock->Close(); } } diff --git a/src/modules/m_spanningtree/server.cpp b/src/modules/m_spanningtree/server.cpp index 64c32e8fb..33c7f47b3 100644 --- a/src/modules/m_spanningtree/server.cpp +++ b/src/modules/m_spanningtree/server.cpp @@ -254,7 +254,7 @@ bool TreeSocket::Inbound_Server(parameterlist ¶ms) // this is good. Send our details: Our server name and description and hopcount of 0, // along with the sendpass from this block. this->SendCapabilities(2); - this->WriteLine(std::string("SERVER ")+ServerInstance->Config->ServerName+" "+this->MakePass(x->SendPass, this->GetTheirChallenge())+" 0 "+ServerInstance->Config->GetSID()+" :"+ServerInstance->Config->ServerDesc); + this->WriteLine("SERVER "+ServerInstance->Config->ServerName+" "+this->MakePass(x->SendPass, this->GetTheirChallenge())+" 0 "+ServerInstance->Config->GetSID()+" :"+ServerInstance->Config->ServerDesc); // move to the next state, we are now waiting for THEM. MyRoot = new TreeServer(Utils, sname, description, sid, Utils->TreeRoot, this, x->Hidden); Utils->TreeRoot->AddChild(MyRoot); diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index a06ff3a67..67908c414 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -129,7 +129,7 @@ void TreeSocket::ProcessLine(std::string &line) } else { - this->SendError(std::string("Invalid command in negotiation phase: ") + command.c_str()); + this->SendError("Invalid command in negotiation phase: " + command); } break; case WAIT_AUTH_2: @@ -394,7 +394,7 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command, { if (params.size() != 2) { - SendError("Protocol violation: NICK message without TS - :"+std::string(who->uuid)+" NICK "+params[0]); + SendError("Protocol violation: NICK message without TS - :"+who->uuid+" NICK "+params[0]); return; } diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index 663a43f2f..6b12a5aaf 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -65,7 +65,7 @@ class CommandTban : public Command } if (!ServerInstance->IsValidMask(parameters[2])) { - user->WriteServ("NOTICE "+std::string(user->nick)+" :Invalid ban mask"); + user->WriteServ("NOTICE "+user->nick+" :Invalid ban mask"); return CMD_FAILURE; } TimedBan T; @@ -74,7 +74,7 @@ class CommandTban : public Command unsigned long expire = duration + ServerInstance->Time(); if (duration < 1) { - user->WriteServ("NOTICE "+std::string(user->nick)+" :Invalid ban time"); + user->WriteServ("NOTICE "+user->nick+" :Invalid ban time"); return CMD_FAILURE; } std::string mask = parameters[2]; diff --git a/src/modules/m_tline.cpp b/src/modules/m_tline.cpp index aca95c0a1..554a12861 100644 --- a/src/modules/m_tline.cpp +++ b/src/modules/m_tline.cpp @@ -49,7 +49,7 @@ class CommandTline : public Command } else { - std::string host = std::string(u->second->ident) + "@" + u->second->GetIPString(); + std::string host = u->second->ident + "@" + u->second->GetIPString(); if (InspIRCd::MatchCIDR(host, parameters[0])) { n_matched++; diff --git a/src/modules/m_userip.cpp b/src/modules/m_userip.cpp index 637c4fd6f..ae826b12a 100644 --- a/src/modules/m_userip.cpp +++ b/src/modules/m_userip.cpp @@ -35,7 +35,7 @@ class CommandUserip : public Command CmdResult Handle (const std::vector<std::string> ¶meters, User *user) { - std::string retbuf = std::string("340 ") + user->nick + " :"; + std::string retbuf = "340 " + user->nick + " :"; int nicks = 0; for (int i = 0; i < (int)parameters.size(); i++) @@ -76,7 +76,7 @@ class ModuleUserIP : public Module virtual void On005Numeric(std::string &output) { - output = output + std::string(" USERIP"); + output = output + " USERIP"; } virtual ~ModuleUserIP() diff --git a/src/modules/m_vhost.cpp b/src/modules/m_vhost.cpp index aac15f58a..8ae231f33 100644 --- a/src/modules/m_vhost.cpp +++ b/src/modules/m_vhost.cpp @@ -56,7 +56,7 @@ class CommandVhost : public Command } } - user->WriteServ("NOTICE "+std::string(user->nick)+" :Invalid username or password."); + user->WriteServ("NOTICE "+user->nick+" :Invalid username or password."); return CMD_FAILURE; } }; diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp index 029055db4..7e98f2fbd 100644 --- a/src/modules/m_watch.cpp +++ b/src/modules/m_watch.cpp @@ -406,12 +406,12 @@ class Modulewatch : public Module if (awaymsg.empty()) { - numeric = std::string(user->nick) + " " + user->ident + " " + user->dhost + " " + ConvToStr(ServerInstance->Time()) + " :is no longer away"; + numeric = user->nick + " " + user->ident + " " + user->dhost + " " + ConvToStr(ServerInstance->Time()) + " :is no longer away"; inum = 599; } else { - numeric = std::string(user->nick) + " " + user->ident + " " + user->dhost + " " + ConvToStr(ServerInstance->Time()) + " :" + awaymsg; + numeric = user->nick + " " + user->ident + " " + user->dhost + " " + ConvToStr(ServerInstance->Time()) + " :" + awaymsg; inum = 598; } diff --git a/src/xline.cpp b/src/xline.cpp index 655b2f940..6ec0723ec 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -539,7 +539,7 @@ void XLine::DefaultApply(User* u, const std::string &line, bool bancache) if (bancache) { - ServerInstance->Logs->Log("BANCACHE", DEBUG, std::string("BanCache: Adding positive hit (") + line + ") for " + u->GetIPString()); + ServerInstance->Logs->Log("BANCACHE", DEBUG, "BanCache: Adding positive hit (" + line + ") for " + u->GetIPString()); if (this->duration > 0) ServerInstance->BanCache->AddHit(u->GetIPString(), this->type, line + "-Lined: " + this->reason, this->duration); else |