diff options
Diffstat (limited to 'src/commands')
43 files changed, 251 insertions, 251 deletions
diff --git a/src/commands/cmd_admin.cpp b/src/commands/cmd_admin.cpp index 5e9b4b4c7..327b675ad 100644 --- a/src/commands/cmd_admin.cpp +++ b/src/commands/cmd_admin.cpp @@ -24,10 +24,10 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) */ CmdResult CommandAdmin::Handle (const std::vector<std::string>& parameters, User *user) { - user->WriteNumeric(256, "%s :Administrative info for %s",user->nick,ServerInstance->Config->ServerName); + user->WriteNumeric(256, "%s :Administrative info for %s",user->nick.c_str(),ServerInstance->Config->ServerName); if (*ServerInstance->Config->AdminName) - user->WriteNumeric(257, "%s :Name - %s",user->nick,ServerInstance->Config->AdminName); - user->WriteNumeric(258, "%s :Nickname - %s",user->nick,ServerInstance->Config->AdminNick); - user->WriteNumeric(259, "%s :E-Mail - %s",user->nick,ServerInstance->Config->AdminEmail); + user->WriteNumeric(257, "%s :Name - %s",user->nick.c_str(),ServerInstance->Config->AdminName); + user->WriteNumeric(258, "%s :Nickname - %s",user->nick.c_str(),ServerInstance->Config->AdminNick); + user->WriteNumeric(259, "%s :E-Mail - %s",user->nick.c_str(),ServerInstance->Config->AdminEmail); return CMD_SUCCESS; } diff --git a/src/commands/cmd_away.cpp b/src/commands/cmd_away.cpp index 7d2522304..7fac7ae6d 100644 --- a/src/commands/cmd_away.cpp +++ b/src/commands/cmd_away.cpp @@ -33,9 +33,9 @@ CmdResult CommandAway::Handle (const std::vector<std::string>& parameters, User return CMD_FAILURE; user->awaytime = ServerInstance->Time(); - strlcpy(user->awaymsg, parameters[0].c_str(), MAXAWAY); + user->awaymsg.assign(parameters[0], 0, MAXAWAY); - user->WriteNumeric(306, "%s :You have been marked as being away",user->nick); + user->WriteNumeric(306, "%s :You have been marked as being away",user->nick.c_str()); } else { @@ -44,8 +44,8 @@ CmdResult CommandAway::Handle (const std::vector<std::string>& parameters, User if (MOD_RESULT != 0 && !IS_LOCAL(user)) return CMD_FAILURE; - *user->awaymsg = 0; - user->WriteNumeric(305, "%s :You are no longer marked as being away",user->nick); + user->awaymsg.empty(); + user->WriteNumeric(305, "%s :You are no longer marked as being away",user->nick.c_str()); } return CMD_SUCCESS; diff --git a/src/commands/cmd_clearcache.cpp b/src/commands/cmd_clearcache.cpp index 5f1792928..aa0ef2c34 100644 --- a/src/commands/cmd_clearcache.cpp +++ b/src/commands/cmd_clearcache.cpp @@ -24,6 +24,6 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) CmdResult CommandClearcache::Handle (const std::vector<std::string>& parameters, User *user) { int n = ServerInstance->Res->ClearCache(); - user->WriteServ("NOTICE %s :*** Cleared DNS cache of %d items.", user->nick, n); + user->WriteServ("NOTICE %s :*** Cleared DNS cache of %d items.", user->nick.c_str(), n); return CMD_SUCCESS; } diff --git a/src/commands/cmd_commands.cpp b/src/commands/cmd_commands.cpp index eddcb6bd8..3f8542aa2 100644 --- a/src/commands/cmd_commands.cpp +++ b/src/commands/cmd_commands.cpp @@ -26,12 +26,12 @@ CmdResult CommandCommands::Handle (const std::vector<std::string>&, User *user) for (Commandable::iterator i = ServerInstance->Parser->cmdlist.begin(); i != ServerInstance->Parser->cmdlist.end(); i++) { user->WriteNumeric(702, "%s :%s %s %d %d", - user->nick, + user->nick.c_str(), i->second->command.c_str(), i->second->source.c_str(), i->second->min_params, i->second->Penalty); } - user->WriteNumeric(704, "%s :End of COMMANDS list",user->nick); + user->WriteNumeric(704, "%s :End of COMMANDS list",user->nick.c_str()); return CMD_SUCCESS; } diff --git a/src/commands/cmd_connect.cpp b/src/commands/cmd_connect.cpp index 81340c37a..0aed872e9 100644 --- a/src/commands/cmd_connect.cpp +++ b/src/commands/cmd_connect.cpp @@ -27,6 +27,6 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) */ CmdResult CommandConnect::Handle (const std::vector<std::string>&, User *user) { - user->WriteServ( "NOTICE %s :Look into loading a linking module (like m_spanningtree) if you want this to do anything useful.", user->nick); + user->WriteServ( "NOTICE %s :Look into loading a linking module (like m_spanningtree) if you want this to do anything useful.", user->nick.c_str()); return CMD_SUCCESS; } diff --git a/src/commands/cmd_die.cpp b/src/commands/cmd_die.cpp index 4278a3a90..342910094 100644 --- a/src/commands/cmd_die.cpp +++ b/src/commands/cmd_die.cpp @@ -39,8 +39,8 @@ CmdResult CommandDie::Handle (const std::vector<std::string>& parameters, User * } else { - ServerInstance->Logs->Log("COMMAND",SPARSE, "Failed /DIE command from %s!%s@%s", user->nick, user->ident, user->host); - ServerInstance->SNO->WriteToSnoMask('A', "Failed DIE Command from %s!%s@%s.",user->nick,user->ident,user->host); + ServerInstance->Logs->Log("COMMAND",SPARSE, "Failed /DIE command from %s!%s@%s", user->nick.c_str(), user->ident.c_str(), user->host); + ServerInstance->SNO->WriteToSnoMask('A', "Failed DIE Command from %s!%s@%s.",user->nick.c_str(),user->ident.c_str(),user->host); return CMD_FAILURE; } return CMD_SUCCESS; diff --git a/src/commands/cmd_eline.cpp b/src/commands/cmd_eline.cpp index 57f0e193c..4f26ace42 100644 --- a/src/commands/cmd_eline.cpp +++ b/src/commands/cmd_eline.cpp @@ -41,7 +41,7 @@ CmdResult CommandEline::Handle (const std::vector<std::string>& parameters, User if (ih.first.empty()) { - user->WriteServ("NOTICE %s :*** Target not found", user->nick); + user->WriteServ("NOTICE %s :*** Target not found", user->nick.c_str()); return CMD_FAILURE; } @@ -50,35 +50,35 @@ CmdResult CommandEline::Handle (const std::vector<std::string>& parameters, User long duration = ServerInstance->Duration(parameters[1].c_str()); - ELine* el = new ELine(ServerInstance, ServerInstance->Time(), duration, user->nick, parameters[2].c_str(), ih.first.c_str(), ih.second.c_str()); + ELine* el = new ELine(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), ih.first.c_str(), ih.second.c_str()); if (ServerInstance->XLines->AddLine(el, user)) { if (!duration) { - ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent E-line for %s.",user->nick,target.c_str()); + ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent E-line for %s.",user->nick.c_str(),target.c_str()); } else { time_t c_requires_crap = duration + ServerInstance->Time(); - ServerInstance->SNO->WriteToSnoMask('x',"%s added timed E-line for %s, expires on %s",user->nick,target.c_str(), + ServerInstance->SNO->WriteToSnoMask('x',"%s added timed E-line for %s, expires on %s",user->nick.c_str(),target.c_str(), ServerInstance->TimeString(c_requires_crap).c_str()); } } else { delete el; - user->WriteServ("NOTICE %s :*** E-Line for %s already exists",user->nick,target.c_str()); + user->WriteServ("NOTICE %s :*** E-Line for %s already exists",user->nick.c_str(),target.c_str()); } } else { if (ServerInstance->XLines->DelLine(target.c_str(), "E", user)) { - ServerInstance->SNO->WriteToSnoMask('x',"%s Removed E-line on %s.",user->nick,target.c_str()); + ServerInstance->SNO->WriteToSnoMask('x',"%s Removed E-line on %s.",user->nick.c_str(),target.c_str()); } else { - user->WriteServ("NOTICE %s :*** E-Line %s not found in list, try /stats e.",user->nick,target.c_str()); + user->WriteServ("NOTICE %s :*** E-Line %s not found in list, try /stats e.",user->nick.c_str(),target.c_str()); } } diff --git a/src/commands/cmd_gline.cpp b/src/commands/cmd_gline.cpp index d2a1f69d6..a10056410 100644 --- a/src/commands/cmd_gline.cpp +++ b/src/commands/cmd_gline.cpp @@ -41,7 +41,7 @@ CmdResult CommandGline::Handle (const std::vector<std::string>& parameters, User if (ih.first.empty()) { - user->WriteServ("NOTICE %s :*** Target not found", user->nick); + user->WriteServ("NOTICE %s :*** Target not found", user->nick.c_str()); return CMD_FAILURE; } @@ -50,22 +50,22 @@ CmdResult CommandGline::Handle (const std::vector<std::string>& parameters, User else if (target.find('!') != std::string::npos) { - user->WriteServ("NOTICE %s :*** G-Line cannot operate on nick!user@host masks",user->nick); + user->WriteServ("NOTICE %s :*** G-Line cannot operate on nick!user@host masks",user->nick.c_str()); return CMD_FAILURE; } long duration = ServerInstance->Duration(parameters[1].c_str()); - GLine* gl = new GLine(ServerInstance, ServerInstance->Time(), duration, user->nick, parameters[2].c_str(), ih.first.c_str(), ih.second.c_str()); + GLine* gl = new GLine(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), ih.first.c_str(), ih.second.c_str()); if (ServerInstance->XLines->AddLine(gl, user)) { if (!duration) { - ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent G-line for %s.",user->nick,target.c_str()); + ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent G-line for %s.",user->nick.c_str(),target.c_str()); } else { time_t c_requires_crap = duration + ServerInstance->Time(); - ServerInstance->SNO->WriteToSnoMask('x',"%s added timed G-line for %s, expires on %s",user->nick,target.c_str(), + ServerInstance->SNO->WriteToSnoMask('x',"%s added timed G-line for %s, expires on %s",user->nick.c_str(),target.c_str(), ServerInstance->TimeString(c_requires_crap).c_str()); } @@ -74,7 +74,7 @@ CmdResult CommandGline::Handle (const std::vector<std::string>& parameters, User else { delete gl; - user->WriteServ("NOTICE %s :*** G-Line for %s already exists",user->nick,target.c_str()); + user->WriteServ("NOTICE %s :*** G-Line for %s already exists",user->nick.c_str(),target.c_str()); } } @@ -82,11 +82,11 @@ CmdResult CommandGline::Handle (const std::vector<std::string>& parameters, User { if (ServerInstance->XLines->DelLine(target.c_str(),"G",user)) { - ServerInstance->SNO->WriteToSnoMask('x',"%s Removed G-line on %s.",user->nick,target.c_str()); + ServerInstance->SNO->WriteToSnoMask('x',"%s Removed G-line on %s.",user->nick.c_str(),target.c_str()); } else { - user->WriteServ("NOTICE %s :*** G-line %s not found in list, try /stats g.",user->nick,target.c_str()); + user->WriteServ("NOTICE %s :*** G-line %s not found in list, try /stats g.",user->nick.c_str(),target.c_str()); } } diff --git a/src/commands/cmd_info.cpp b/src/commands/cmd_info.cpp index 346168960..517153948 100644 --- a/src/commands/cmd_info.cpp +++ b/src/commands/cmd_info.cpp @@ -23,38 +23,38 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) */ CmdResult CommandInfo::Handle (const std::vector<std::string>&, User *user) { - user->WriteServ( "371 %s : -/\\- \2InspIRCd\2 -\\/-", user->nick); - user->WriteServ( "371 %s : November 2002 - Present", user->nick); - user->WriteServ( "371 %s : ", user->nick); - user->WriteServ( "371 %s :\2Core Developers\2:", user->nick); - user->WriteServ( "371 %s : Craig Edwards, Brain, <brain@inspircd.org>", user->nick); - user->WriteServ( "371 %s : Craig McLure, Craig, <craig@inspircd.org>", user->nick); - user->WriteServ( "371 %s : Robin Burchell, w00t, <w00t@inspircd.org>", user->nick); - user->WriteServ( "371 %s : Oliver Lupton, Om, <om@inspircd.org>", user->nick); - user->WriteServ( "371 %s : John Brooks, Special, <special@inspircd.org>", user->nick); - user->WriteServ( "371 %s : Pippijn van Steenhoven, pippijn, <pippijn@one09.net>", user->nick); - user->WriteServ( "371 %s : Dennis Friis, peavey, <peavey@inspircd.org>", user->nick); - user->WriteServ( "371 %s : Thomas Stagner, aquanight, <aquanight@inspircd.org>", user->nick); - user->WriteServ( "371 %s : Eric Dietz, fez, <fez@inspircd.org>", user->nick); - user->WriteServ( "371 %s : ", user->nick); - user->WriteServ( "371 %s :\2Regular Contributors\2:", user->nick); - user->WriteServ( "371 %s : satmd nenolod John2 Skip", user->nick); - user->WriteServ( "371 %s : jilles Majic eggy Trystan", user->nick); - user->WriteServ( "371 %s : Quension danieldg praetorian", user->nick); - user->WriteServ( "371 %s : GreenReaper searchirc.com irc-junkie.org", user->nick); - user->WriteServ( "371 %s : ", user->nick); - user->WriteServ( "371 %s :\2Other Contributors\2:", user->nick); - user->WriteServ( "371 %s : dmb Zaba skenmy LeaChim", user->nick); - user->WriteServ( "371 %s : Thunderhacker Dan Jason owine", user->nick); - user->WriteServ( "371 %s : Adremelech dz BuildSmart HiroP", user->nick); - user->WriteServ( "371 %s : ThaPrince Bricker AnMaster djGrrr", user->nick); - user->WriteServ( "371 %s : ", user->nick); - user->WriteServ( "371 %s :\2Former Contributors\2:", user->nick); - user->WriteServ( "371 %s : CC jamie typobox43 Burlex (win32)", user->nick); - user->WriteServ( "371 %s : Stskeeps ", user->nick); - user->WriteServ( "371 %s : ", user->nick); - user->WriteServ( "371 %s : Best experienced with: \2An IRC client\2", user->nick); + user->WriteServ( "371 %s : -/\\- \2InspIRCd\2 -\\/-", user->nick.c_str()); + user->WriteServ( "371 %s : November 2002 - Present", user->nick.c_str()); + user->WriteServ( "371 %s : ", user->nick.c_str()); + user->WriteServ( "371 %s :\2Core Developers\2:", user->nick.c_str()); + user->WriteServ( "371 %s : Craig Edwards, Brain, <brain@inspircd.org>", user->nick.c_str()); + user->WriteServ( "371 %s : Craig McLure, Craig, <craig@inspircd.org>", user->nick.c_str()); + user->WriteServ( "371 %s : Robin Burchell, w00t, <w00t@inspircd.org>", user->nick.c_str()); + user->WriteServ( "371 %s : Oliver Lupton, Om, <om@inspircd.org>", user->nick.c_str()); + user->WriteServ( "371 %s : John Brooks, Special, <special@inspircd.org>", user->nick.c_str()); + user->WriteServ( "371 %s : Pippijn van Steenhoven, pippijn, <pippijn@one09.net>", user->nick.c_str()); + user->WriteServ( "371 %s : Dennis Friis, peavey, <peavey@inspircd.org>", user->nick.c_str()); + user->WriteServ( "371 %s : Thomas Stagner, aquanight, <aquanight@inspircd.org>", user->nick.c_str()); + user->WriteServ( "371 %s : Eric Dietz, fez, <fez@inspircd.org>", user->nick.c_str()); + user->WriteServ( "371 %s : ", user->nick.c_str()); + user->WriteServ( "371 %s :\2Regular Contributors\2:", user->nick.c_str()); + user->WriteServ( "371 %s : satmd nenolod John2 Skip", user->nick.c_str()); + user->WriteServ( "371 %s : jilles Majic eggy Trystan", user->nick.c_str()); + user->WriteServ( "371 %s : Quension danieldg praetorian", user->nick.c_str()); + user->WriteServ( "371 %s : GreenReaper searchirc.com irc-junkie.org", user->nick.c_str()); + user->WriteServ( "371 %s : ", user->nick.c_str()); + user->WriteServ( "371 %s :\2Other Contributors\2:", user->nick.c_str()); + user->WriteServ( "371 %s : dmb Zaba skenmy LeaChim", user->nick.c_str()); + user->WriteServ( "371 %s : Thunderhacker Dan Jason owine", user->nick.c_str()); + user->WriteServ( "371 %s : Adremelech dz BuildSmart HiroP", user->nick.c_str()); + user->WriteServ( "371 %s : ThaPrince Bricker AnMaster djGrrr", user->nick.c_str()); + user->WriteServ( "371 %s : ", user->nick.c_str()); + user->WriteServ( "371 %s :\2Former Contributors\2:", user->nick.c_str()); + user->WriteServ( "371 %s : CC jamie typobox43 Burlex (win32)", user->nick.c_str()); + user->WriteServ( "371 %s : Stskeeps ", user->nick.c_str()); + user->WriteServ( "371 %s : ", user->nick.c_str()); + user->WriteServ( "371 %s : Best experienced with: \2An IRC client\2", user->nick.c_str()); FOREACH_MOD(I_OnInfo,OnInfo(user)); - user->WriteServ( "374 %s :End of /INFO list", user->nick); + user->WriteServ( "374 %s :End of /INFO list", user->nick.c_str()); return CMD_SUCCESS; } diff --git a/src/commands/cmd_invite.cpp b/src/commands/cmd_invite.cpp index db1c64eac..1455e94e7 100644 --- a/src/commands/cmd_invite.cpp +++ b/src/commands/cmd_invite.cpp @@ -37,7 +37,7 @@ CmdResult CommandInvite::Handle (const std::vector<std::string>& parameters, Use if ((!c) || (!u)) { - user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick, c ? parameters[0].c_str() : parameters[1].c_str()); + user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick.c_str(), c ? parameters[0].c_str() : parameters[1].c_str()); return CMD_FAILURE; } @@ -45,20 +45,20 @@ CmdResult CommandInvite::Handle (const std::vector<std::string>& parameters, Use { if (c->GetStatus(user) < STATUS_HOP) { - user->WriteNumeric(482, "%s %s :You must be a channel %soperator", user->nick, c->name, c->GetStatus(u) == STATUS_HOP ? "" : "half-"); + user->WriteNumeric(482, "%s %s :You must be a channel %soperator", user->nick.c_str(), c->name, c->GetStatus(u) == STATUS_HOP ? "" : "half-"); return CMD_FAILURE; } } if (c->HasUser(u)) { - user->WriteNumeric(443, "%s %s %s :is already on channel",user->nick,u->nick,c->name); + user->WriteNumeric(443, "%s %s %s :is already on channel",user->nick.c_str(),u->nick.c_str(),c->name); return CMD_FAILURE; } if ((IS_LOCAL(user)) && (!c->HasUser(user))) { - user->WriteNumeric(442, "%s %s :You're not on that channel!",user->nick, c->name); + user->WriteNumeric(442, "%s %s :You're not on that channel!",user->nick.c_str(), c->name); return CMD_FAILURE; } @@ -70,21 +70,21 @@ CmdResult CommandInvite::Handle (const std::vector<std::string>& parameters, Use } u->InviteTo(c->name, timeout); - u->WriteFrom(user,"INVITE %s :%s",u->nick,c->name); - user->WriteNumeric(341, "%s %s %s",user->nick,u->nick,c->name); + u->WriteFrom(user,"INVITE %s :%s",u->nick.c_str(),c->name); + user->WriteNumeric(341, "%s %s %s",user->nick.c_str(),u->nick.c_str(),c->name); switch (ServerInstance->Config->AnnounceInvites) { case ServerConfig::INVITE_ANNOUNCE_ALL: - c->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :*** %s invited %s into the channel", c->name, user->nick, u->nick); + c->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :*** %s invited %s into the channel", c->name, user->nick.c_str(), u->nick.c_str()); break; case ServerConfig::INVITE_ANNOUNCE_OPS: - c->WriteAllExceptSender(user, true, '@', "NOTICE %s :*** %s invited %s into the channel", c->name, user->nick, u->nick); + c->WriteAllExceptSender(user, true, '@', "NOTICE %s :*** %s invited %s into the channel", c->name, user->nick.c_str(), u->nick.c_str()); break; case ServerConfig::INVITE_ANNOUNCE_DYNAMIC: if (c->IsModeSet('i')) - c->WriteAllExceptSender(user, true, '@', "NOTICE %s :*** %s invited %s into the channel", c->name, user->nick, u->nick); + c->WriteAllExceptSender(user, true, '@', "NOTICE %s :*** %s invited %s into the channel", c->name, user->nick.c_str(), u->nick.c_str()); else - c->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :*** %s invited %s into the channel", c->name, user->nick, u->nick); + c->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :*** %s invited %s into the channel", c->name, user->nick.c_str(), u->nick.c_str()); break; default: /* Nobody */ @@ -99,9 +99,9 @@ CmdResult CommandInvite::Handle (const std::vector<std::string>& parameters, Use InvitedList* il = user->GetInviteList(); for (InvitedList::iterator i = il->begin(); i != il->end(); i++) { - user->WriteNumeric(346, "%s :%s",user->nick,i->first.c_str()); + user->WriteNumeric(346, "%s :%s",user->nick.c_str(),i->first.c_str()); } - user->WriteNumeric(347, "%s :End of INVITE list",user->nick); + user->WriteNumeric(347, "%s :End of INVITE list",user->nick.c_str()); } return CMD_SUCCESS; } diff --git a/src/commands/cmd_join.cpp b/src/commands/cmd_join.cpp index e7c841399..b27007507 100644 --- a/src/commands/cmd_join.cpp +++ b/src/commands/cmd_join.cpp @@ -46,6 +46,6 @@ CmdResult CommandJoin::Handle (const std::vector<std::string>& parameters, User } } - user->WriteNumeric(403, "%s %s :Invalid channel name",user->nick, parameters[0].c_str()); + user->WriteNumeric(403, "%s %s :Invalid channel name",user->nick.c_str(), parameters[0].c_str()); return CMD_FAILURE; } diff --git a/src/commands/cmd_kick.cpp b/src/commands/cmd_kick.cpp index 99859b413..174800cf5 100644 --- a/src/commands/cmd_kick.cpp +++ b/src/commands/cmd_kick.cpp @@ -32,13 +32,13 @@ CmdResult CommandKick::Handle (const std::vector<std::string>& parameters, User if (!u || !c) { - user->WriteServ( "401 %s %s :No such nick/channel", user->nick, u ? parameters[0].c_str() : parameters[1].c_str()); + user->WriteServ( "401 %s %s :No such nick/channel", user->nick.c_str(), u ? parameters[0].c_str() : parameters[1].c_str()); return CMD_FAILURE; } if ((IS_LOCAL(user)) && (!c->HasUser(user)) && (!ServerInstance->ULine(user->server))) { - user->WriteServ( "442 %s %s :You're not on that channel!", user->nick, parameters[0].c_str()); + user->WriteServ( "442 %s %s :You're not on that channel!", user->nick.c_str(), parameters[0].c_str()); return CMD_FAILURE; } @@ -48,7 +48,7 @@ CmdResult CommandKick::Handle (const std::vector<std::string>& parameters, User } else { - strlcpy(reason, user->nick, MAXKICK - 1); + strlcpy(reason, user->nick.c_str(), MAXKICK - 1); } if (!c->KickUser(user, u, reason)) diff --git a/src/commands/cmd_kill.cpp b/src/commands/cmd_kill.cpp index 7e77aa5a1..48e1ac84e 100644 --- a/src/commands/cmd_kill.cpp +++ b/src/commands/cmd_kill.cpp @@ -59,7 +59,7 @@ CmdResult CommandKill::Handle (const std::vector<std::string>& parameters, User else { // hidekills is off, do nothing - snprintf(killreason, MAXQUIT, "Killed (%s (%s))", user->nick, parameters[1].c_str()); + snprintf(killreason, MAXQUIT, "Killed (%s (%s))", user->nick.c_str(), parameters[1].c_str()); } } else @@ -75,7 +75,7 @@ CmdResult CommandKill::Handle (const std::vector<std::string>& parameters, User if (!IS_LOCAL(u)) { // remote kill - ServerInstance->SNO->WriteToSnoMask('K', "Remote kill by %s: %s!%s@%s (%s)", user->nick, u->nick, u->ident, u->host, parameters[1].c_str()); + ServerInstance->SNO->WriteToSnoMask('K', "Remote kill by %s: %s!%s@%s (%s)", user->nick.c_str(), u->nick.c_str(), u->ident.c_str(), u->host, parameters[1].c_str()); FOREACH_MOD(I_OnRemoteKill, OnRemoteKill(user, u, killreason, killreason)); } else @@ -85,18 +85,18 @@ CmdResult CommandKill::Handle (const std::vector<std::string>& parameters, User * XXX - this isn't entirely correct, servers A - B - C, oper on A, client on C. Oper kills client, A and B will get remote kill * snotices, C will get a local kill snotice. this isn't accurate, and needs fixing at some stage. -- w00t */ - ServerInstance->SNO->WriteToSnoMask('k',"Local Kill by %s: %s!%s@%s (%s)", user->nick, u->nick, u->ident, u->host, parameters[1].c_str()); - ServerInstance->Logs->Log("KILL",DEFAULT,"LOCAL KILL: %s :%s!%s!%s (%s)", u->nick, ServerInstance->Config->ServerName, user->dhost, user->nick, parameters[1].c_str()); + ServerInstance->SNO->WriteToSnoMask('k',"Local Kill by %s: %s!%s@%s (%s)", user->nick.c_str(), u->nick.c_str(), u->ident.c_str(), u->host, parameters[1].c_str()); + ServerInstance->Logs->Log("KILL",DEFAULT,"LOCAL KILL: %s :%s!%s!%s (%s)", u->nick.c_str(), ServerInstance->Config->ServerName, user->dhost.c_str(), user->nick.c_str(), parameters[1].c_str()); /* Bug #419, make sure this message can only occur once even in the case of multiple KILL messages crossing the network, and change to show * hidekillsserver as source if possible */ if (!u->quitting) { - u->Write(":%s KILL %s :%s!%s!%s (%s)", *ServerInstance->Config->HideKillsServer ? ServerInstance->Config->HideKillsServer : user->GetFullHost(), - u->nick, + u->Write(":%s KILL %s :%s!%s!%s (%s)", *ServerInstance->Config->HideKillsServer ? ServerInstance->Config->HideKillsServer : user->GetFullHost().c_str(), + u->nick.c_str(), ServerInstance->Config->ServerName, - user->dhost, - *ServerInstance->Config->HideKillsServer ? ServerInstance->Config->HideKillsServer : user->nick, + user->dhost.c_str(), + *ServerInstance->Config->HideKillsServer ? ServerInstance->Config->HideKillsServer : user->nick.c_str(), parameters[1].c_str()); } } @@ -106,7 +106,7 @@ CmdResult CommandKill::Handle (const std::vector<std::string>& parameters, User } else { - user->WriteServ( "401 %s %s :No such nick/channel", user->nick, parameters[0].c_str()); + user->WriteServ( "401 %s %s :No such nick/channel", user->nick.c_str(), parameters[0].c_str()); return CMD_FAILURE; } diff --git a/src/commands/cmd_kline.cpp b/src/commands/cmd_kline.cpp index ddf5d218b..95e24a7ea 100644 --- a/src/commands/cmd_kline.cpp +++ b/src/commands/cmd_kline.cpp @@ -41,7 +41,7 @@ CmdResult CommandKline::Handle (const std::vector<std::string>& parameters, User if (ih.first.empty()) { - user->WriteServ("NOTICE %s :*** Target not found", user->nick); + user->WriteServ("NOTICE %s :*** Target not found", user->nick.c_str()); return CMD_FAILURE; } @@ -50,22 +50,22 @@ CmdResult CommandKline::Handle (const std::vector<std::string>& parameters, User if (target.find('!') != std::string::npos) { - user->WriteServ("NOTICE %s :*** K-Line cannot operate on nick!user@host masks",user->nick); + user->WriteServ("NOTICE %s :*** K-Line cannot operate on nick!user@host masks",user->nick.c_str()); return CMD_FAILURE; } long duration = ServerInstance->Duration(parameters[1].c_str()); - KLine* kl = new KLine(ServerInstance, ServerInstance->Time(), duration, user->nick, parameters[2].c_str(), ih.first.c_str(), ih.second.c_str()); + KLine* kl = new KLine(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), ih.first.c_str(), ih.second.c_str()); if (ServerInstance->XLines->AddLine(kl,user)) { if (!duration) { - ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent K-line for %s.",user->nick,target.c_str()); + ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent K-line for %s.",user->nick.c_str(),target.c_str()); } else { time_t c_requires_crap = duration + ServerInstance->Time(); - ServerInstance->SNO->WriteToSnoMask('x',"%s added timed K-line for %s, expires on %s",user->nick,target.c_str(), + ServerInstance->SNO->WriteToSnoMask('x',"%s added timed K-line for %s, expires on %s",user->nick.c_str(),target.c_str(), ServerInstance->TimeString(c_requires_crap).c_str()); } @@ -74,18 +74,18 @@ CmdResult CommandKline::Handle (const std::vector<std::string>& parameters, User else { delete kl; - user->WriteServ("NOTICE %s :*** K-Line for %s already exists",user->nick,target.c_str()); + user->WriteServ("NOTICE %s :*** K-Line for %s already exists",user->nick.c_str(),target.c_str()); } } else { if (ServerInstance->XLines->DelLine(target.c_str(),"K",user)) { - ServerInstance->SNO->WriteToSnoMask('x',"%s Removed K-line on %s.",user->nick,target.c_str()); + ServerInstance->SNO->WriteToSnoMask('x',"%s Removed K-line on %s.",user->nick.c_str(),target.c_str()); } else { - user->WriteServ("NOTICE %s :*** K-Line %s not found in list, try /stats k.",user->nick,target.c_str()); + user->WriteServ("NOTICE %s :*** K-Line %s not found in list, try /stats k.",user->nick.c_str(),target.c_str()); } } diff --git a/src/commands/cmd_links.cpp b/src/commands/cmd_links.cpp index 554e6d962..988e50be2 100644 --- a/src/commands/cmd_links.cpp +++ b/src/commands/cmd_links.cpp @@ -23,7 +23,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) */ CmdResult CommandLinks::Handle (const std::vector<std::string>&, User *user) { - user->WriteNumeric(364, "%s %s %s :0 %s",user->nick,ServerInstance->Config->ServerName,ServerInstance->Config->ServerName,ServerInstance->Config->ServerDesc); - user->WriteNumeric(365, "%s * :End of /LINKS list.",user->nick); + user->WriteNumeric(364, "%s %s %s :0 %s",user->nick.c_str(),ServerInstance->Config->ServerName,ServerInstance->Config->ServerName,ServerInstance->Config->ServerDesc); + user->WriteNumeric(365, "%s * :End of /LINKS list.",user->nick.c_str()); return CMD_SUCCESS; } diff --git a/src/commands/cmd_list.cpp b/src/commands/cmd_list.cpp index 164830a26..62bf8d628 100644 --- a/src/commands/cmd_list.cpp +++ b/src/commands/cmd_list.cpp @@ -26,7 +26,7 @@ CmdResult CommandList::Handle (const std::vector<std::string>& parameters, User { int minusers = 0, maxusers = 0; - user->WriteNumeric(321, "%s Channel :Users Name",user->nick); + user->WriteNumeric(321, "%s Channel :Users Name",user->nick.c_str()); /* Work around mIRC suckyness. YOU SUCK, KHALED! */ if (parameters.size() == 1) @@ -62,17 +62,17 @@ CmdResult CommandList::Handle (const std::vector<std::string>& parameters, User bool n = (i->second->HasUser(user) || IS_OPER(user)); if (!IS_OPER(user) && (i->second->IsModeSet('p')) && (!n)) { - user->WriteNumeric(322, "%s * %ld :",user->nick, users); + user->WriteNumeric(322, "%s * %ld :",user->nick.c_str(), users); } else { if (IS_OPER(user) || (((!(i->second->IsModeSet('p'))) && (!(i->second->IsModeSet('s')))) || (n))) { - user->WriteNumeric(322, "%s %s %ld :[+%s] %s",user->nick,i->second->name,users,i->second->ChanModes(n),i->second->topic); + user->WriteNumeric(322, "%s %s %ld :[+%s] %s",user->nick.c_str(),i->second->name,users,i->second->ChanModes(n),i->second->topic); } } } - user->WriteNumeric(323, "%s :End of channel list.",user->nick); + user->WriteNumeric(323, "%s :End of channel list.",user->nick.c_str()); return CMD_SUCCESS; } diff --git a/src/commands/cmd_loadmodule.cpp b/src/commands/cmd_loadmodule.cpp index 31bb02ca0..8060b47d5 100644 --- a/src/commands/cmd_loadmodule.cpp +++ b/src/commands/cmd_loadmodule.cpp @@ -25,13 +25,13 @@ CmdResult CommandLoadmodule::Handle (const std::vector<std::string>& parameters, { if (ServerInstance->Modules->Load(parameters[0].c_str())) { - ServerInstance->SNO->WriteToSnoMask('A', "NEW MODULE: %s loaded %s",user->nick, parameters[0].c_str()); - user->WriteNumeric(975, "%s %s :Module successfully loaded.",user->nick, parameters[0].c_str()); + ServerInstance->SNO->WriteToSnoMask('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()); return CMD_SUCCESS; } else { - user->WriteNumeric(974, "%s %s :%s",user->nick, parameters[0].c_str(), ServerInstance->Modules->LastError().c_str()); + user->WriteNumeric(974, "%s %s :%s",user->nick.c_str(), parameters[0].c_str(), ServerInstance->Modules->LastError().c_str()); return CMD_FAILURE; } } diff --git a/src/commands/cmd_lusers.cpp b/src/commands/cmd_lusers.cpp index 11f34d8d7..23e8b8234 100644 --- a/src/commands/cmd_lusers.cpp +++ b/src/commands/cmd_lusers.cpp @@ -25,15 +25,15 @@ CmdResult CommandLusers::Handle (const std::vector<std::string>&, User *user) { // this lusers command shows one server at all times because // a protocol module must override it to show those stats. - user->WriteNumeric(251, "%s :There are %d users and %d invisible on 1 server",user->nick,ServerInstance->Users->UserCount()-ServerInstance->Users->ModeCount('i'),ServerInstance->Users->ModeCount('i')); + user->WriteNumeric(251, "%s :There are %d users and %d invisible on 1 server",user->nick.c_str(),ServerInstance->Users->UserCount()-ServerInstance->Users->ModeCount('i'),ServerInstance->Users->ModeCount('i')); if (ServerInstance->Users->OperCount()) - user->WriteNumeric(252, "%s %d :operator(s) online",user->nick,ServerInstance->Users->OperCount()); + user->WriteNumeric(252, "%s %d :operator(s) online",user->nick.c_str(),ServerInstance->Users->OperCount()); if (ServerInstance->Users->UnregisteredUserCount()) - user->WriteNumeric(253, "%s %d :unknown connections",user->nick,ServerInstance->Users->UnregisteredUserCount()); + user->WriteNumeric(253, "%s %d :unknown connections",user->nick.c_str(),ServerInstance->Users->UnregisteredUserCount()); if (ServerInstance->ChannelCount()) - user->WriteNumeric(254, "%s %ld :channels formed",user->nick,ServerInstance->ChannelCount()); + user->WriteNumeric(254, "%s %ld :channels formed",user->nick.c_str(),ServerInstance->ChannelCount()); if (ServerInstance->Users->LocalUserCount()) - user->WriteNumeric(255, "%s :I have %d clients and 0 servers",user->nick,ServerInstance->Users->LocalUserCount()); + user->WriteNumeric(255, "%s :I have %d clients and 0 servers",user->nick.c_str(),ServerInstance->Users->LocalUserCount()); return CMD_SUCCESS; } diff --git a/src/commands/cmd_map.cpp b/src/commands/cmd_map.cpp index cea9f39cf..1ee1f0eb0 100644 --- a/src/commands/cmd_map.cpp +++ b/src/commands/cmd_map.cpp @@ -26,8 +26,8 @@ CmdResult CommandMap::Handle (const std::vector<std::string>&, User *user) // as with /LUSERS this does nothing without a linking // module to override its behaviour and display something // better. - user->WriteNumeric(006, "%s :%s",user->nick,ServerInstance->Config->ServerName); - user->WriteNumeric(007, "%s :End of /MAP",user->nick); + user->WriteNumeric(006, "%s :%s",user->nick.c_str(),ServerInstance->Config->ServerName); + user->WriteNumeric(007, "%s :End of /MAP",user->nick.c_str()); return CMD_SUCCESS; } diff --git a/src/commands/cmd_modules.cpp b/src/commands/cmd_modules.cpp index 0409e6341..9474dece4 100644 --- a/src/commands/cmd_modules.cpp +++ b/src/commands/cmd_modules.cpp @@ -62,14 +62,14 @@ CmdResult CommandModules::Handle (const std::vector<std::string>&, User *user) strlcpy(modulename,module_names[i].c_str(),256); if (IS_OPER(user)) { - user->WriteNumeric(702, "%s :0x%08lx %d.%d.%d.%d %s (%s)",user->nick,(unsigned long)m,V.Major,V.Minor,V.Revision,V.Build,ServerConfig::CleanFilename(modulename),flagstate+2); + user->WriteNumeric(702, "%s :0x%08lx %d.%d.%d.%d %s (%s)",user->nick.c_str(),(unsigned long)m,V.Major,V.Minor,V.Revision,V.Build,ServerConfig::CleanFilename(modulename),flagstate+2); } else { - user->WriteNumeric(702, "%s :%s",user->nick,ServerConfig::CleanFilename(modulename)); + user->WriteNumeric(702, "%s :%s",user->nick.c_str(),ServerConfig::CleanFilename(modulename)); } } - user->WriteNumeric(703, "%s :End of MODULES list",user->nick); + user->WriteNumeric(703, "%s :End of MODULES list",user->nick.c_str()); return CMD_SUCCESS; } diff --git a/src/commands/cmd_names.cpp b/src/commands/cmd_names.cpp index 7e2b9cdee..acf516e86 100644 --- a/src/commands/cmd_names.cpp +++ b/src/commands/cmd_names.cpp @@ -27,7 +27,7 @@ CmdResult CommandNames::Handle (const std::vector<std::string>& parameters, User if (!parameters.size()) { - user->WriteNumeric(366, "%s * :End of /NAMES list.",user->nick); + user->WriteNumeric(366, "%s * :End of /NAMES list.",user->nick.c_str()); return CMD_SUCCESS; } @@ -39,14 +39,14 @@ CmdResult CommandNames::Handle (const std::vector<std::string>& parameters, User { if ((c->IsModeSet('s')) && (!c->HasUser(user))) { - user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick, c->name); + user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick.c_str(), c->name); return CMD_FAILURE; } c->UserList(user); } else { - user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick, parameters[0].c_str()); + user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick.c_str(), parameters[0].c_str()); } return CMD_SUCCESS; diff --git a/src/commands/cmd_nick.cpp b/src/commands/cmd_nick.cpp index 0ae781cc0..8a8dbb6dd 100644 --- a/src/commands/cmd_nick.cpp +++ b/src/commands/cmd_nick.cpp @@ -32,7 +32,7 @@ CmdResult CommandNick::Handle (const std::vector<std::string>& parameters, User if (parameters[0].empty()) { /* We cant put blanks in the parameters, so for this (extremely rare) issue we just put '*' here. */ - user->WriteNumeric(432, "%s * :Erroneous Nickname", *user->nick ? user->nick : "*"); + user->WriteNumeric(432, "%s * :Erroneous Nickname", user->nick.empty() ? user->nick.c_str() : "*"); return CMD_FAILURE; } @@ -52,12 +52,12 @@ CmdResult CommandNick::Handle (const std::vector<std::string>& parameters, User return CMD_SUCCESS; } - user->WriteNumeric(432, "%s %s :Erroneous Nickname", user->nick,parameters[0].c_str()); + user->WriteNumeric(432, "%s %s :Erroneous Nickname", user->nick.c_str(),parameters[0].c_str()); return CMD_FAILURE; } } - if (irc::string(user->nick) == assign(parameters[0])) + if (irc::string(user->nick.c_str()) == assign(parameters[0])) { /* If its exactly the same, even case, dont do anything. */ if (parameters[0] == user->nick) @@ -67,14 +67,14 @@ CmdResult CommandNick::Handle (const std::vector<std::string>& parameters, User * able to do silly things like this even though the RFC says * the nick AAA is the same as the nick aaa. */ - strlcpy(oldnick, user->nick, NICKMAX - 1); + strlcpy(oldnick, user->nick.c_str(), NICKMAX - 1); int MOD_RESULT = 0; FOREACH_RESULT(I_OnUserPreNick,OnUserPreNick(user,parameters[0].c_str())); if (MOD_RESULT) return CMD_FAILURE; if (user->registered == REG_ALL) user->WriteCommon("NICK %s",parameters[0].c_str()); - strlcpy(user->nick, parameters[0].c_str(), NICKMAX - 1); + user->nick.assign(parameters[0], 0, NICKMAX - 1); user->InvalidateCache(); FOREACH_MOD(I_OnUserPostNick,OnUserPostNick(user,oldnick)); return CMD_SUCCESS; @@ -94,8 +94,8 @@ CmdResult CommandNick::Handle (const std::vector<std::string>& parameters, User XLine* mq = ServerInstance->XLines->MatchesLine("Q",parameters[0]); if (mq) { - ServerInstance->SNO->WriteToSnoMask('x', "Q-Lined nickname %s from %s!%s@%s: %s", parameters[0].c_str(), user->nick, user->ident, user->host, mq->reason); - user->WriteNumeric(432, "%s %s :Invalid nickname: %s",user->nick, parameters[0].c_str(), mq->reason); + ServerInstance->SNO->WriteToSnoMask('x', "Q-Lined nickname %s from %s!%s@%s: %s", parameters[0].c_str(), user->nick.c_str(), user->ident.c_str(), user->host, mq->reason); + user->WriteNumeric(432, "%s %s :Invalid nickname: %s",user->nick.c_str(), parameters[0].c_str(), mq->reason); return CMD_FAILURE; } } @@ -115,17 +115,17 @@ CmdResult CommandNick::Handle (const std::vector<std::string>& parameters, User if (InUse->registered != REG_ALL) { /* force the camper to their UUID, and ask them to re-send a NICK. */ - InUse->WriteTo(InUse, "NICK %s", InUse->uuid); - InUse->WriteNumeric(433, "%s %s :Nickname overruled.", InUse->nick, InUse->nick); - InUse->UpdateNickHash(InUse->uuid); - strlcpy(InUse->nick, InUse->uuid, NICKMAX - 1); + InUse->WriteTo(InUse, "NICK %s", InUse->uuid.c_str()); + InUse->WriteNumeric(433, "%s %s :Nickname overruled.", InUse->nick.c_str(), InUse->nick.c_str()); + InUse->UpdateNickHash(InUse->uuid.c_str()); + InUse->nick.assign(InUse->uuid, 0, NICKMAX - 1); InUse->InvalidateCache(); InUse->registered &= ~REG_NICK; } else { /* No camping, tell the incoming user to stop trying to change nick ;p */ - user->WriteNumeric(433, "%s %s :Nickname is already in use.", user->registered >= REG_NICK ? user->nick : "*", parameters[0].c_str()); + user->WriteNumeric(433, "%s %s :Nickname is already in use.", user->registered >= REG_NICK ? user->nick.c_str() : "*", parameters[0].c_str()); return CMD_FAILURE; } } @@ -141,7 +141,7 @@ CmdResult CommandNick::Handle (const std::vector<std::string>& parameters, User if (user->registered == REG_ALL) user->WriteCommon("NICK %s", parameters[0].c_str()); - strlcpy(oldnick, user->nick, NICKMAX - 1); + strlcpy(oldnick, user->nick.c_str(), NICKMAX - 1); /* change the nick of the user in the users_hash */ user = user->UpdateNickHash(parameters[0].c_str()); @@ -149,10 +149,10 @@ CmdResult CommandNick::Handle (const std::vector<std::string>& parameters, User /* actually change the nick within the record */ if (!user) return CMD_FAILURE; - if (!*user->nick) + if (!user->nick.empty()) return CMD_FAILURE; - strlcpy(user->nick, parameters[0].c_str(), NICKMAX - 1); + user->nick.assign(parameters[0], 0, NICKMAX - 1); user->InvalidateCache(); diff --git a/src/commands/cmd_notice.cpp b/src/commands/cmd_notice.cpp index 451b67074..6c8762a30 100644 --- a/src/commands/cmd_notice.cpp +++ b/src/commands/cmd_notice.cpp @@ -69,12 +69,12 @@ CmdResult CommandNotice::Handle (const std::vector<std::string>& parameters, Use { if ((chan->IsModeSet('n')) && (!chan->HasUser(user))) { - user->WriteNumeric(404, "%s %s :Cannot send to channel (no external messages)", user->nick, chan->name); + user->WriteNumeric(404, "%s %s :Cannot send to channel (no external messages)", user->nick.c_str(), chan->name); return CMD_FAILURE; } if ((chan->IsModeSet('m')) && (chan->GetStatus(user) < STATUS_VOICE)) { - user->WriteNumeric(404, "%s %s :Cannot send to channel (+m)", user->nick, chan->name); + user->WriteNumeric(404, "%s %s :Cannot send to channel (+m)", user->nick.c_str(), chan->name); return CMD_FAILURE; } } @@ -89,7 +89,7 @@ CmdResult CommandNotice::Handle (const std::vector<std::string>& parameters, Use if (temp.empty()) { - user->WriteNumeric(412, "%s :No text to send", user->nick); + user->WriteNumeric(412, "%s :No text to send", user->nick.c_str()); return CMD_FAILURE; } @@ -116,7 +116,7 @@ CmdResult CommandNotice::Handle (const std::vector<std::string>& parameters, Use else { /* no such nick/channel */ - user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick, target); + user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick.c_str(), target); return CMD_FAILURE; } return CMD_SUCCESS; @@ -136,7 +136,7 @@ CmdResult CommandNotice::Handle (const std::vector<std::string>& parameters, Use if (dest && strcasecmp(dest->server, targetserver + 1)) { /* Incorrect server for user */ - user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick, parameters[0].c_str()); + user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick.c_str(), parameters[0].c_str()); return CMD_FAILURE; } } @@ -150,7 +150,7 @@ CmdResult CommandNotice::Handle (const std::vector<std::string>& parameters, Use { if (parameters[1].empty()) { - user->WriteNumeric(412, "%s :No text to send", user->nick); + user->WriteNumeric(412, "%s :No text to send", user->nick.c_str()); return CMD_FAILURE; } @@ -167,7 +167,7 @@ CmdResult CommandNotice::Handle (const std::vector<std::string>& parameters, Use if (IS_LOCAL(dest)) { // direct write, same server - user->WriteTo(dest, "NOTICE %s :%s", dest->nick, text); + user->WriteTo(dest, "NOTICE %s :%s", dest->nick.c_str(), text); } FOREACH_MOD(I_OnUserNotice,OnUserNotice(user,dest,TYPE_USER,text,0,exempt_list)); @@ -175,7 +175,7 @@ CmdResult CommandNotice::Handle (const std::vector<std::string>& parameters, Use else { /* no such nick/channel */ - user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick, parameters[0].c_str()); + user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick.c_str(), parameters[0].c_str()); return CMD_FAILURE; } diff --git a/src/commands/cmd_oper.cpp b/src/commands/cmd_oper.cpp index 0e08c3357..8a3303093 100644 --- a/src/commands/cmd_oper.cpp +++ b/src/commands/cmd_oper.cpp @@ -54,8 +54,8 @@ CmdResult CommandOper::Handle (const std::vector<std::string>& parameters, User bool match_pass = false; bool match_hosts = false; - snprintf(TheHost,MAXBUF,"%s@%s",user->ident,user->host); - snprintf(TheIP, MAXBUF,"%s@%s",user->ident,user->GetIPString()); + snprintf(TheHost,MAXBUF,"%s@%s",user->ident.c_str(),user->host); + snprintf(TheIP, MAXBUF,"%s@%s",user->ident.c_str(),user->GetIPString()); for (int i = 0; i < ServerInstance->Config->ConfValueEnum(ServerInstance->Config->config_data, "oper"); i++) { @@ -82,9 +82,9 @@ CmdResult CommandOper::Handle (const std::vector<std::string>& parameters, User /* found this oper's opertype */ if (!ServerInstance->IsNick(TypeName)) { - user->WriteNumeric(491, "%s :Invalid oper type (oper types must follow the same syntax as nicknames)",user->nick); + user->WriteNumeric(491, "%s :Invalid oper type (oper types must follow the same syntax as nicknames)",user->nick.c_str()); ServerInstance->SNO->WriteToSnoMask('o',"CONFIGURATION ERROR! Oper type '%s' contains invalid characters",OperType); - ServerInstance->Logs->Log("OPER",DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: credentials valid, but oper type erroneous.",user->nick,user->ident,user->host); + ServerInstance->Logs->Log("OPER",DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: credentials valid, but oper type erroneous.",user->nick.c_str(),user->ident.c_str(),user->host); return CMD_FAILURE; } ServerInstance->Config->ConfValue(ServerInstance->Config->config_data, "type","host", j, HostName, MAXBUF); @@ -107,8 +107,8 @@ CmdResult CommandOper::Handle (const std::vector<std::string>& parameters, User if (found) { /* correct oper credentials */ - ServerInstance->SNO->WriteToSnoMask('o',"%s (%s@%s) is now an IRC operator of type %s (using oper '%s')",user->nick,user->ident,user->host,irc::Spacify(OperType),parameters[0].c_str()); - user->WriteNumeric(381, "%s :You are now %s %s",user->nick, strchr("aeiouAEIOU", *OperType) ? "an" : "a", irc::Spacify(OperType)); + ServerInstance->SNO->WriteToSnoMask('o',"%s (%s@%s) is now an IRC operator of type %s (using oper '%s')",user->nick.c_str(),user->ident.c_str(),user->host,irc::Spacify(OperType),parameters[0].c_str()); + user->WriteNumeric(381, "%s :You are now %s %s",user->nick.c_str(), strchr("aeiouAEIOU", *OperType) ? "an" : "a", irc::Spacify(OperType)); if (!user->IsModeSet('o')) user->Oper(OperType, LoginName); } @@ -130,25 +130,25 @@ CmdResult CommandOper::Handle (const std::vector<std::string>& parameters, User } // tell them they suck, and lag them up to help prevent brute-force attacks - user->WriteNumeric(491, "%s :Invalid oper credentials",user->nick); + user->WriteNumeric(491, "%s :Invalid oper credentials",user->nick.c_str()); user->IncreasePenalty(10); - snprintf(broadcast, MAXBUF, "WARNING! Failed oper attempt by %s!%s@%s using login '%s': The following fields do not match: %s",user->nick,user->ident,user->host, parameters[0].c_str(), fields.c_str()); + snprintf(broadcast, MAXBUF, "WARNING! Failed oper attempt by %s!%s@%s using login '%s': The following fields do not match: %s",user->nick.c_str(),user->ident.c_str(),user->host, parameters[0].c_str(), fields.c_str()); ServerInstance->SNO->WriteToSnoMask('o',std::string(broadcast)); ServerInstance->PI->SendSNONotice("o", std::string("OPER: ") + broadcast); - ServerInstance->Logs->Log("OPER",DEFAULT,"OPER: Failed oper attempt by %s!%s@%s using login '%s': The following fields did not match: %s",user->nick,user->ident,user->host,parameters[0].c_str(),fields.c_str()); + ServerInstance->Logs->Log("OPER",DEFAULT,"OPER: Failed oper attempt by %s!%s@%s using login '%s': The following fields did not match: %s",user->nick.c_str(),user->ident.c_str(),user->host,parameters[0].c_str(),fields.c_str()); return CMD_FAILURE; } else { - user->WriteNumeric(491, "%s :Your oper block does not have a valid opertype associated with it",user->nick); + user->WriteNumeric(491, "%s :Your oper block does not have a valid opertype associated with it",user->nick.c_str()); snprintf(broadcast, MAXBUF, "CONFIGURATION ERROR! Oper block '%s': missing OperType %s",parameters[0].c_str(),OperType); ServerInstance->SNO->WriteToSnoMask('o', std::string(broadcast)); - ServerInstance->Logs->Log("OPER",DEFAULT,"OPER: Failed oper attempt by %s!%s@%s using login '%s': credentials valid, but oper type nonexistent.",user->nick,user->ident,user->host,parameters[0].c_str()); + ServerInstance->Logs->Log("OPER",DEFAULT,"OPER: Failed oper attempt by %s!%s@%s using login '%s': credentials valid, but oper type nonexistent.",user->nick.c_str(),user->ident.c_str(),user->host,parameters[0].c_str()); return CMD_FAILURE; } } diff --git a/src/commands/cmd_part.cpp b/src/commands/cmd_part.cpp index 07b45367f..352b967b5 100644 --- a/src/commands/cmd_part.cpp +++ b/src/commands/cmd_part.cpp @@ -54,7 +54,7 @@ CmdResult CommandPart::Handle (const std::vector<std::string>& parameters, User } else { - user->WriteServ( "401 %s %s :No such channel", user->nick, parameters[0].c_str()); + user->WriteServ( "401 %s %s :No such channel", user->nick.c_str(), parameters[0].c_str()); return CMD_FAILURE; } diff --git a/src/commands/cmd_pass.cpp b/src/commands/cmd_pass.cpp index 2e1a702a2..b9b55d007 100644 --- a/src/commands/cmd_pass.cpp +++ b/src/commands/cmd_pass.cpp @@ -24,14 +24,14 @@ CmdResult CommandPass::Handle (const std::vector<std::string>& parameters, User // Check to make sure they havnt registered -- Fix by FCS if (user->registered == REG_ALL) { - user->WriteNumeric(462, "%s :You may not reregister",user->nick); + user->WriteNumeric(462, "%s :You may not reregister",user->nick.c_str()); return CMD_FAILURE; } ConnectClass* a = user->GetClass(); if (!a) return CMD_FAILURE; - strlcpy(user->password, parameters[0].c_str(), 63); + user->password.assign(parameters[0], 0, 63); if (!ServerInstance->PassCompare(user, a->GetPass().c_str(), parameters[0].c_str(), a->GetHash().c_str())) user->haspassed = true; diff --git a/src/commands/cmd_privmsg.cpp b/src/commands/cmd_privmsg.cpp index 1c4ba277e..c4d604959 100644 --- a/src/commands/cmd_privmsg.cpp +++ b/src/commands/cmd_privmsg.cpp @@ -70,12 +70,12 @@ CmdResult CommandPrivmsg::Handle (const std::vector<std::string>& parameters, Us { if ((chan->IsModeSet('n')) && (!chan->HasUser(user))) { - user->WriteNumeric(404, "%s %s :Cannot send to channel (no external messages)", user->nick, chan->name); + user->WriteNumeric(404, "%s %s :Cannot send to channel (no external messages)", user->nick.c_str(), chan->name); return CMD_FAILURE; } if ((chan->IsModeSet('m')) && (chan->GetStatus(user) < STATUS_VOICE)) { - user->WriteNumeric(404, "%s %s :Cannot send to channel (+m)", user->nick, chan->name); + user->WriteNumeric(404, "%s %s :Cannot send to channel (+m)", user->nick.c_str(), chan->name); return CMD_FAILURE; } } @@ -91,7 +91,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector<std::string>& parameters, Us /* Check again, a module may have zapped the input string */ if (temp.empty()) { - user->WriteNumeric(412, "%s :No text to send", user->nick); + user->WriteNumeric(412, "%s :No text to send", user->nick.c_str()); return CMD_FAILURE; } @@ -118,7 +118,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector<std::string>& parameters, Us else { /* no such nick/channel */ - user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick, target); + user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick.c_str(), target); return CMD_FAILURE; } return CMD_SUCCESS; @@ -138,7 +138,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector<std::string>& parameters, Us if (dest && strcasecmp(dest->server, targetserver + 1)) { /* Incorrect server for user */ - user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick, parameters[0].c_str()); + user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick.c_str(), parameters[0].c_str()); return CMD_FAILURE; } } @@ -152,14 +152,14 @@ CmdResult CommandPrivmsg::Handle (const std::vector<std::string>& parameters, Us { if (parameters[1].empty()) { - user->WriteNumeric(412, "%s :No text to send", user->nick); + user->WriteNumeric(412, "%s :No text to send", user->nick.c_str()); return CMD_FAILURE; } if (IS_AWAY(dest)) { /* auto respond with aweh msg */ - user->WriteNumeric(301, "%s %s :%s",user->nick,dest->nick,dest->awaymsg); + user->WriteNumeric(301, "%s %s :%s",user->nick.c_str(),dest->nick.c_str(),dest->awaymsg.c_str()); } int MOD_RESULT = 0; @@ -176,7 +176,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector<std::string>& parameters, Us if (IS_LOCAL(dest)) { // direct write, same server - user->WriteTo(dest, "PRIVMSG %s :%s", dest->nick, text); + user->WriteTo(dest, "PRIVMSG %s :%s", dest->nick.c_str(), text); } FOREACH_MOD(I_OnUserMessage,OnUserMessage(user, dest, TYPE_USER, text, 0, except_list)); @@ -184,7 +184,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector<std::string>& parameters, Us else { /* no such nick/channel */ - user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick, parameters[0].c_str()); + user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick.c_str(), parameters[0].c_str()); return CMD_FAILURE; } return CMD_SUCCESS; diff --git a/src/commands/cmd_qline.cpp b/src/commands/cmd_qline.cpp index f3471a6b3..ea7498736 100644 --- a/src/commands/cmd_qline.cpp +++ b/src/commands/cmd_qline.cpp @@ -31,22 +31,22 @@ CmdResult CommandQline::Handle (const std::vector<std::string>& parameters, User if (parameters[0].find('@') != std::string::npos || parameters[0].find('!') != std::string::npos || parameters[0].find('.') != std::string::npos) { - user->WriteServ("NOTICE %s :*** A Q-Line only bans a nick pattern, not a nick!user@host pattern.",user->nick); + user->WriteServ("NOTICE %s :*** A Q-Line only bans a nick pattern, not a nick!user@host pattern.",user->nick.c_str()); return CMD_FAILURE; } long duration = ServerInstance->Duration(parameters[1].c_str()); - QLine* ql = new QLine(ServerInstance, ServerInstance->Time(), duration, user->nick, parameters[2].c_str(), parameters[0].c_str()); + QLine* ql = new QLine(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), parameters[0].c_str()); if (ServerInstance->XLines->AddLine(ql,user)) { if (!duration) { - ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent Q-line for %s.",user->nick,parameters[0].c_str()); + ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent Q-line for %s.",user->nick.c_str(),parameters[0].c_str()); } else { time_t c_requires_crap = duration + ServerInstance->Time(); - ServerInstance->SNO->WriteToSnoMask('x',"%s added timed Q-line for %s, expires on %s",user->nick,parameters[0].c_str(), + ServerInstance->SNO->WriteToSnoMask('x',"%s added timed Q-line for %s, expires on %s",user->nick.c_str(),parameters[0].c_str(), ServerInstance->TimeString(c_requires_crap).c_str()); } ServerInstance->XLines->ApplyLines(); @@ -54,18 +54,18 @@ CmdResult CommandQline::Handle (const std::vector<std::string>& parameters, User else { delete ql; - user->WriteServ("NOTICE %s :*** Q-Line for %s already exists",user->nick,parameters[0].c_str()); + user->WriteServ("NOTICE %s :*** Q-Line for %s already exists",user->nick.c_str(),parameters[0].c_str()); } } else { if (ServerInstance->XLines->DelLine(parameters[0].c_str(), "Q", user)) { - ServerInstance->SNO->WriteToSnoMask('x',"%s Removed Q-line on %s.",user->nick,parameters[0].c_str()); + ServerInstance->SNO->WriteToSnoMask('x',"%s Removed Q-line on %s.",user->nick.c_str(),parameters[0].c_str()); } else { - user->WriteServ("NOTICE %s :*** Q-Line %s not found in list, try /stats q.",user->nick,parameters[0].c_str()); + user->WriteServ("NOTICE %s :*** Q-Line %s not found in list, try /stats q.",user->nick.c_str(),parameters[0].c_str()); return CMD_FAILURE; } } diff --git a/src/commands/cmd_rehash.cpp b/src/commands/cmd_rehash.cpp index ce34239a5..6a7ed124b 100644 --- a/src/commands/cmd_rehash.cpp +++ b/src/commands/cmd_rehash.cpp @@ -44,9 +44,9 @@ CmdResult CommandRehash::Handle (const std::vector<std::string>& parameters, Use FOREACH_MOD(I_OnRehash,OnRehash(user, "")); // XXX write this to a remote user correctly - user->WriteNumeric(382, "%s %s :Rehashing",user->nick,ServerConfig::CleanFilename(ServerInstance->ConfigFileName)); + user->WriteNumeric(382, "%s %s :Rehashing",user->nick.c_str(),ServerConfig::CleanFilename(ServerInstance->ConfigFileName)); - std::string m = std::string(user->nick) + " is rehashing config file " + ServerConfig::CleanFilename(ServerInstance->ConfigFileName) + " on " + ServerInstance->Config->ServerName; + std::string m = user->nick + " is rehashing config file " + ServerConfig::CleanFilename(ServerInstance->ConfigFileName) + " on " + ServerInstance->Config->ServerName; ServerInstance->SNO->WriteToSnoMask('A', m); ServerInstance->Logs->CloseLogs(); @@ -71,7 +71,7 @@ CmdResult CommandRehash::Handle (const std::vector<std::string>& parameters, Use { /* A rehash is already in progress! ahh shit. */ if (IS_LOCAL(user)) - user->WriteServ("NOTICE %s :*** Could not rehash: A rehash is already in progress.", user->nick); + user->WriteServ("NOTICE %s :*** Could not rehash: A rehash is already in progress.", user->nick.c_str()); else ServerInstance->PI->SendUserNotice(user, "*** Could not rehash: A rehash is already in progress."); diff --git a/src/commands/cmd_reloadmodule.cpp b/src/commands/cmd_reloadmodule.cpp index 05162e631..f968a49ad 100644 --- a/src/commands/cmd_reloadmodule.cpp +++ b/src/commands/cmd_reloadmodule.cpp @@ -23,16 +23,16 @@ CmdResult CommandReloadmodule::Handle (const std::vector<std::string>& parameter { if (ServerInstance->Modules->Unload(parameters[0].c_str())) { - ServerInstance->SNO->WriteToSnoMask('A', "RELOAD MODULE: %s unloaded %s",user->nick, parameters[0].c_str()); + ServerInstance->SNO->WriteToSnoMask('A', "RELOAD MODULE: %s unloaded %s",user->nick.c_str(), parameters[0].c_str()); if (ServerInstance->Modules->Load(parameters[0].c_str())) { - ServerInstance->SNO->WriteToSnoMask('A', "RELOAD MODULE: %s reloaded %s",user->nick, parameters[0].c_str()); - user->WriteNumeric(975, "%s %s :Module successfully reloaded.",user->nick, parameters[0].c_str()); + ServerInstance->SNO->WriteToSnoMask('A', "RELOAD MODULE: %s reloaded %s",user->nick.c_str(), parameters[0].c_str()); + user->WriteNumeric(975, "%s %s :Module successfully reloaded.",user->nick.c_str(), parameters[0].c_str()); return CMD_SUCCESS; } } - ServerInstance->SNO->WriteToSnoMask('A', "RELOAD MODULE: %s unsuccessfully reloaded %s",user->nick, parameters[0].c_str()); - user->WriteNumeric(975, "%s %s :%s",user->nick, parameters[0].c_str(), ServerInstance->Modules->LastError().c_str()); + ServerInstance->SNO->WriteToSnoMask('A', "RELOAD MODULE: %s unsuccessfully reloaded %s",user->nick.c_str(), parameters[0].c_str()); + user->WriteNumeric(975, "%s %s :%s",user->nick.c_str(), parameters[0].c_str(), ServerInstance->Modules->LastError().c_str()); return CMD_FAILURE; } diff --git a/src/commands/cmd_restart.cpp b/src/commands/cmd_restart.cpp index 334fb621f..7251b1fa6 100644 --- a/src/commands/cmd_restart.cpp +++ b/src/commands/cmd_restart.cpp @@ -21,10 +21,10 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) CmdResult CommandRestart::Handle (const std::vector<std::string>& parameters, User *user) { - ServerInstance->Logs->Log("COMMAND",DEFAULT,"Restart: %s",user->nick); + ServerInstance->Logs->Log("COMMAND",DEFAULT,"Restart: %s",user->nick.c_str()); if (!ServerInstance->PassCompare(user, ServerInstance->Config->restartpass, parameters[0].c_str(), ServerInstance->Config->powerhash)) { - ServerInstance->SNO->WriteToSnoMask('A', "RESTART command from %s!%s@%s, restarting server.",user->nick,user->ident,user->host); + ServerInstance->SNO->WriteToSnoMask('A', "RESTART command from %s!%s@%s, restarting server.",user->nick.c_str(),user->ident.c_str(),user->host); try { @@ -38,7 +38,7 @@ CmdResult CommandRestart::Handle (const std::vector<std::string>& parameters, Us } else { - ServerInstance->SNO->WriteToSnoMask('A', "Failed RESTART Command from %s!%s@%s.",user->nick,user->ident,user->host); + ServerInstance->SNO->WriteToSnoMask('A', "Failed RESTART Command from %s!%s@%s.",user->nick.c_str(),user->ident.c_str(),user->host); return CMD_FAILURE; } diff --git a/src/commands/cmd_server.cpp b/src/commands/cmd_server.cpp index 5385428b8..c7b413406 100644 --- a/src/commands/cmd_server.cpp +++ b/src/commands/cmd_server.cpp @@ -23,7 +23,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) CmdResult CommandServer::Handle (const std::vector<std::string>&, User *user) { - user->WriteNumeric(666, "%s :You cannot identify as a server, you are a USER. IRC Operators informed.",user->nick); - ServerInstance->SNO->WriteToSnoMask('A', "WARNING: %s attempted to issue a SERVER command and is registered as a user!", user->nick); + user->WriteNumeric(666, "%s :You cannot identify as a server, you are a USER. IRC Operators informed.",user->nick.c_str()); + ServerInstance->SNO->WriteToSnoMask('A', "WARNING: %s attempted to issue a SERVER command and is registered as a user!", user->nick.c_str()); return CMD_FAILURE; } diff --git a/src/commands/cmd_squit.cpp b/src/commands/cmd_squit.cpp index 61d0a601d..2fd5c701c 100644 --- a/src/commands/cmd_squit.cpp +++ b/src/commands/cmd_squit.cpp @@ -26,6 +26,6 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) CmdResult CommandSquit::Handle (const std::vector<std::string>&, User *user) { - user->WriteServ( "NOTICE %s :Look into loading a linking module (like m_spanningtree) if you want this to do anything useful.", user->nick); + user->WriteServ( "NOTICE %s :Look into loading a linking module (like m_spanningtree) if you want this to do anything useful.", user->nick.c_str()); return CMD_FAILURE; } diff --git a/src/commands/cmd_stats.cpp b/src/commands/cmd_stats.cpp index 174094afa..093d46c6c 100644 --- a/src/commands/cmd_stats.cpp +++ b/src/commands/cmd_stats.cpp @@ -53,7 +53,7 @@ DllExport void DoStats(InspIRCd* ServerInstance, char statschar, User* user, str ServerInstance->SNO->WriteToSnoMask('t', "%s '%c' denied for %s (%s@%s)", (IS_LOCAL(user) ? "Stats" : "Remote stats"), - statschar, user->nick, user->ident, user->host); + statschar, user->nick.c_str(), user->ident.c_str(), user->host); results.push_back(sn + " 481 " + user->nick + " :Permission denied - STATS " + statschar + " is oper-only"); return; } @@ -239,7 +239,7 @@ DllExport void DoStats(InspIRCd* ServerInstance, char statschar, User* user, str results.push_back(sn+" 249 "+user->nick+" :nick collisions "+ConvToStr(ServerInstance->stats->statsCollisions)); results.push_back(sn+" 249 "+user->nick+" :dns requests "+ConvToStr(ServerInstance->stats->statsDnsGood+ServerInstance->stats->statsDnsBad)+" succeeded "+ConvToStr(ServerInstance->stats->statsDnsGood)+" failed "+ConvToStr(ServerInstance->stats->statsDnsBad)); results.push_back(sn+" 249 "+user->nick+" :connection count "+ConvToStr(ServerInstance->stats->statsConnects)); - snprintf(buffer,MAXBUF," 249 %s :bytes sent %5.2fK recv %5.2fK",user->nick,ServerInstance->stats->statsSent / 1024,ServerInstance->stats->statsRecv / 1024); + snprintf(buffer,MAXBUF," 249 %s :bytes sent %5.2fK recv %5.2fK",user->nick.c_str(),ServerInstance->stats->statsSent / 1024,ServerInstance->stats->statsRecv / 1024); results.push_back(sn+buffer); } break; @@ -264,7 +264,7 @@ DllExport void DoStats(InspIRCd* ServerInstance, char statschar, User* user, str for (std::vector<User*>::iterator n = ServerInstance->Users->local_users.begin(); n != ServerInstance->Users->local_users.end(); n++) { User* i = *n; - if (ServerInstance->IsNick(i->nick)) + if (ServerInstance->IsNick(i->nick.c_str())) { results.push_back(sn+" 211 "+user->nick+" "+i->nick+"["+i->ident+"@"+i->dhost+"] "+ConvToStr(i->sendq.length())+" "+ConvToStr(i->cmds_out)+" "+ConvToStr(i->bytes_out)+" "+ConvToStr(i->cmds_in)+" "+ConvToStr(i->bytes_in)+" "+ConvToStr(ServerInstance->Time() - i->age)); } @@ -277,7 +277,7 @@ DllExport void DoStats(InspIRCd* ServerInstance, char statschar, User* user, str for (std::vector<User*>::iterator n = ServerInstance->Users->local_users.begin(); n != ServerInstance->Users->local_users.end(); n++) { User* i = *n; - if (ServerInstance->IsNick(i->nick)) + if (ServerInstance->IsNick(i->nick.c_str())) { results.push_back(sn+" 211 "+user->nick+" "+i->nick+"["+i->ident+"@"+i->GetIPString()+"] "+ConvToStr(i->sendq.length())+" "+ConvToStr(i->cmds_out)+" "+ConvToStr(i->bytes_out)+" "+ConvToStr(i->cmds_in)+" "+ConvToStr(i->bytes_in)+" "+ConvToStr(ServerInstance->Time() - i->age)); } @@ -297,13 +297,13 @@ DllExport void DoStats(InspIRCd* ServerInstance, char statschar, User* user, str if (stime->tm_year > 70) { char buffer[MAXBUF]; - snprintf(buffer,MAXBUF," 242 %s :Server up %d years, %d days, %.2d:%.2d:%.2d",user->nick,(stime->tm_year-70),stime->tm_yday,stime->tm_hour,stime->tm_min,stime->tm_sec); + snprintf(buffer,MAXBUF," 242 %s :Server up %d years, %d days, %.2d:%.2d:%.2d",user->nick.c_str(),(stime->tm_year-70),stime->tm_yday,stime->tm_hour,stime->tm_min,stime->tm_sec); results.push_back(sn+buffer); } else { char buffer[MAXBUF]; - snprintf(buffer,MAXBUF," 242 %s :Server up %d days, %.2d:%.2d:%.2d",user->nick,stime->tm_yday,stime->tm_hour,stime->tm_min,stime->tm_sec); + snprintf(buffer,MAXBUF," 242 %s :Server up %d days, %.2d:%.2d:%.2d",user->nick.c_str(),stime->tm_yday,stime->tm_hour,stime->tm_min,stime->tm_sec); results.push_back(sn+buffer); } } @@ -315,6 +315,6 @@ DllExport void DoStats(InspIRCd* ServerInstance, char statschar, User* user, str results.push_back(sn+" 219 "+user->nick+" "+statschar+" :End of /STATS report"); ServerInstance->SNO->WriteToSnoMask('t',"%s '%c' requested by %s (%s@%s)", - (IS_LOCAL(user) ? "Stats" : "Remote stats"), statschar, user->nick, user->ident, user->host); + (IS_LOCAL(user) ? "Stats" : "Remote stats"), statschar, user->nick.c_str(), user->ident.c_str(), user->host); return; } diff --git a/src/commands/cmd_time.cpp b/src/commands/cmd_time.cpp index d8c3561b0..79b8e823d 100644 --- a/src/commands/cmd_time.cpp +++ b/src/commands/cmd_time.cpp @@ -32,7 +32,7 @@ CmdResult CommandTime::Handle (const std::vector<std::string>&, User *user) snprintf(tms,26,"%s",asctime(timeinfo)); tms[24] = 0; - user->WriteNumeric(391, "%s %s :%s",user->nick,ServerInstance->Config->ServerName,tms); + user->WriteNumeric(391, "%s %s :%s",user->nick.c_str(),ServerInstance->Config->ServerName,tms); return CMD_SUCCESS; } diff --git a/src/commands/cmd_topic.cpp b/src/commands/cmd_topic.cpp index 9f9d56b14..f228243bd 100644 --- a/src/commands/cmd_topic.cpp +++ b/src/commands/cmd_topic.cpp @@ -31,22 +31,22 @@ CmdResult CommandTopic::Handle (const std::vector<std::string>& parameters, User { if ((Ptr->IsModeSet('s')) && (!Ptr->HasUser(user))) { - user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick, Ptr->name); + user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick.c_str(), Ptr->name); return CMD_FAILURE; } if (Ptr->topicset) { - user->WriteNumeric(332, "%s %s :%s", user->nick, Ptr->name, Ptr->topic); - user->WriteNumeric(333, "%s %s %s %lu", user->nick, Ptr->name, Ptr->setby, (unsigned long)Ptr->topicset); + user->WriteNumeric(332, "%s %s :%s", user->nick.c_str(), Ptr->name, Ptr->topic); + user->WriteNumeric(333, "%s %s %s %lu", user->nick.c_str(), Ptr->name, Ptr->setby, (unsigned long)Ptr->topicset); } else { - user->WriteNumeric(331, "%s %s :No topic is set.", user->nick, Ptr->name); + user->WriteNumeric(331, "%s %s :No topic is set.", user->nick.c_str(), Ptr->name); } } else { - user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick, parameters[0].c_str()); + user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick.c_str(), parameters[0].c_str()); return CMD_FAILURE; } return CMD_SUCCESS; @@ -60,12 +60,12 @@ CmdResult CommandTopic::Handle (const std::vector<std::string>& parameters, User { if (!Ptr->HasUser(user)) { - user->WriteNumeric(442, "%s %s :You're not on that channel!",user->nick, Ptr->name); + user->WriteNumeric(442, "%s %s :You're not on that channel!",user->nick.c_str(), Ptr->name); return CMD_FAILURE; } if ((Ptr->IsModeSet('t')) && (Ptr->GetStatus(user) < STATUS_HOP)) { - user->WriteNumeric(482, "%s %s :You must be at least a half-operator to change the topic on this channel", user->nick, Ptr->name); + user->WriteNumeric(482, "%s %s :You must be at least a half-operator to change the topic on this channel", user->nick.c_str(), Ptr->name); return CMD_FAILURE; } } @@ -93,9 +93,9 @@ CmdResult CommandTopic::Handle (const std::vector<std::string>& parameters, User } if (ServerInstance->Config->FullHostInTopic) - strlcpy(Ptr->setby,user->GetFullHost(),127); + strlcpy(Ptr->setby,user->GetFullHost().c_str(),127); else - strlcpy(Ptr->setby,user->nick,127); + strlcpy(Ptr->setby,user->nick.c_str(),127); Ptr->topicset = ServerInstance->Time(); Ptr->WriteChannel(user, "TOPIC %s :%s", Ptr->name, Ptr->topic); @@ -106,7 +106,7 @@ CmdResult CommandTopic::Handle (const std::vector<std::string>& parameters, User } else { - user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick, parameters[0].c_str()); + user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick.c_str(), parameters[0].c_str()); return CMD_FAILURE; } } diff --git a/src/commands/cmd_unloadmodule.cpp b/src/commands/cmd_unloadmodule.cpp index 68ad591ce..4c1e685fb 100644 --- a/src/commands/cmd_unloadmodule.cpp +++ b/src/commands/cmd_unloadmodule.cpp @@ -25,12 +25,12 @@ CmdResult CommandUnloadmodule::Handle (const std::vector<std::string>& parameter { if (ServerInstance->Modules->Unload(parameters[0].c_str())) { - ServerInstance->SNO->WriteToSnoMask('A', "MODULE UNLOADED: %s unloaded %s", user->nick, parameters[0].c_str()); - user->WriteNumeric(973, "%s %s :Module successfully unloaded.",user->nick, parameters[0].c_str()); + ServerInstance->SNO->WriteToSnoMask('A', "MODULE UNLOADED: %s unloaded %s", user->nick.c_str(), parameters[0].c_str()); + user->WriteNumeric(973, "%s %s :Module successfully unloaded.",user->nick.c_str(), parameters[0].c_str()); } else { - user->WriteNumeric(972, "%s %s :%s",user->nick, parameters[0].c_str(), ServerInstance->Modules->LastError().c_str()); + user->WriteNumeric(972, "%s %s :%s",user->nick.c_str(), parameters[0].c_str(), ServerInstance->Modules->LastError().c_str()); return CMD_FAILURE; } diff --git a/src/commands/cmd_user.cpp b/src/commands/cmd_user.cpp index 46d42771b..1acd901f9 100644 --- a/src/commands/cmd_user.cpp +++ b/src/commands/cmd_user.cpp @@ -30,7 +30,7 @@ CmdResult CommandUser::Handle (const std::vector<std::string>& parameters, User * RFC says we must use this numeric, so we do. Let's make it a little more nub friendly though. :) * -- Craig, and then w00t. */ - user->WriteNumeric(461, "%s USER :Your username is not valid",user->nick); + user->WriteNumeric(461, "%s USER :Your username is not valid",user->nick.c_str()); return CMD_FAILURE; } else @@ -40,14 +40,14 @@ CmdResult CommandUser::Handle (const std::vector<std::string>& parameters, User * ~ character, and +1 for null termination, therefore we can safely use up to * IDENTMAX here. */ - strlcpy(user->ident, parameters[0].c_str(), IDENTMAX); - strlcpy(user->fullname, !parameters[3].empty() ? parameters[3].c_str() : "No info", MAXGECOS); + user->ident.assign(parameters[0], 0, IDENTMAX); + user->fullname.assign(parameters[3].empty() ? std::string("No info") : parameters[3], 0, MAXGECOS); user->registered = (user->registered | REG_USER); } } else { - user->WriteNumeric(462, "%s :You may not reregister",user->nick); + user->WriteNumeric(462, "%s :You may not reregister",user->nick.c_str()); return CMD_FAILURE; } diff --git a/src/commands/cmd_version.cpp b/src/commands/cmd_version.cpp index 1951417d7..091577aba 100644 --- a/src/commands/cmd_version.cpp +++ b/src/commands/cmd_version.cpp @@ -23,7 +23,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) CmdResult CommandVersion::Handle (const std::vector<std::string>&, User *user) { - user->WriteNumeric(351, "%s :%s",user->nick,ServerInstance->GetVersionString().c_str()); + user->WriteNumeric(351, "%s :%s",user->nick.c_str(),ServerInstance->GetVersionString().c_str()); ServerInstance->Config->Send005(user); return CMD_SUCCESS; } diff --git a/src/commands/cmd_who.cpp b/src/commands/cmd_who.cpp index 2c91cb6e7..7f4365204 100644 --- a/src/commands/cmd_who.cpp +++ b/src/commands/cmd_who.cpp @@ -335,13 +335,13 @@ CmdResult CommandWho::Handle (const std::vector<std::string>& parameters, User * { for (std::vector<std::string>::const_iterator n = whoresults.begin(); n != whoresults.end(); n++) user->WriteServ(*n); - user->WriteNumeric(315, "%s %s :End of /WHO list.",user->nick, *parameters[0].c_str() ? parameters[0].c_str() : "*"); + user->WriteNumeric(315, "%s %s :End of /WHO list.",user->nick.c_str(), *parameters[0].c_str() ? parameters[0].c_str() : "*"); return CMD_SUCCESS; } else { /* BZZT! Too many results. */ - user->WriteNumeric(315, "%s %s :Too many results",user->nick, parameters[0].c_str()); + user->WriteNumeric(315, "%s %s :Too many results",user->nick.c_str(), parameters[0].c_str()); return CMD_FAILURE; } } diff --git a/src/commands/cmd_whois.cpp b/src/commands/cmd_whois.cpp index d78144348..9858ff93a 100644 --- a/src/commands/cmd_whois.cpp +++ b/src/commands/cmd_whois.cpp @@ -19,17 +19,17 @@ void do_whois(InspIRCd* ServerInstance, User* user, User* dest,unsigned long sig { if (dest->Visibility && !dest->Visibility->VisibleTo(user)) { - ServerInstance->SendWhoisLine(user, dest, 401, "%s %s :No such nick/channel",user->nick, *nick ? nick : "*"); - ServerInstance->SendWhoisLine(user, dest, 318, "%s %s :End of /WHOIS list.",user->nick, *nick ? nick : "*"); + ServerInstance->SendWhoisLine(user, dest, 401, "%s %s :No such nick/channel",user->nick.c_str(), *nick ? nick : "*"); + ServerInstance->SendWhoisLine(user, dest, 318, "%s %s :End of /WHOIS list.",user->nick.c_str(), *nick ? nick : "*"); return; } if (dest->registered == REG_ALL) { - ServerInstance->SendWhoisLine(user, dest, 311, "%s %s %s %s * :%s",user->nick, dest->nick, dest->ident, dest->dhost, dest->fullname); + ServerInstance->SendWhoisLine(user, dest, 311, "%s %s %s %s * :%s",user->nick.c_str(), dest->nick.c_str(), dest->ident.c_str(), dest->dhost.c_str(), dest->fullname.c_str()); if (user == dest || IS_OPER(user)) { - ServerInstance->SendWhoisLine(user, dest, 378, "%s %s :is connecting from %s@%s %s", user->nick, dest->nick, dest->ident, dest->host, dest->GetIPString()); + ServerInstance->SendWhoisLine(user, dest, 378, "%s %s :is connecting from %s@%s %s", user->nick.c_str(), dest->nick.c_str(), dest->ident.c_str(), dest->host, dest->GetIPString()); } std::string cl = dest->ChannelList(user); @@ -42,37 +42,37 @@ void do_whois(InspIRCd* ServerInstance, User* user, User* dest,unsigned long sig } else { - ServerInstance->SendWhoisLine(user, dest, 319, "%s %s :%s",user->nick, dest->nick, cl.c_str()); + ServerInstance->SendWhoisLine(user, dest, 319, "%s %s :%s",user->nick.c_str(), dest->nick.c_str(), cl.c_str()); } } if (*ServerInstance->Config->HideWhoisServer && !IS_OPER(user)) { - ServerInstance->SendWhoisLine(user, dest, 312, "%s %s %s :%s",user->nick, dest->nick, ServerInstance->Config->HideWhoisServer, ServerInstance->Config->Network); + ServerInstance->SendWhoisLine(user, dest, 312, "%s %s %s :%s",user->nick.c_str(), dest->nick.c_str(), ServerInstance->Config->HideWhoisServer, ServerInstance->Config->Network); } else { - ServerInstance->SendWhoisLine(user, dest, 312, "%s %s %s :%s",user->nick, dest->nick, dest->server, ServerInstance->GetServerDescription(dest->server).c_str()); + ServerInstance->SendWhoisLine(user, dest, 312, "%s %s %s :%s",user->nick.c_str(), dest->nick.c_str(), dest->server, ServerInstance->GetServerDescription(dest->server).c_str()); } if (IS_AWAY(dest)) { - ServerInstance->SendWhoisLine(user, dest, 301, "%s %s :%s",user->nick, dest->nick, dest->awaymsg); + ServerInstance->SendWhoisLine(user, dest, 301, "%s %s :%s",user->nick.c_str(), dest->nick.c_str(), dest->awaymsg.c_str()); } if (IS_OPER(dest)) { - ServerInstance->SendWhoisLine(user, dest, 313, "%s %s :is %s %s on %s",user->nick, dest->nick, (strchr("AEIOUaeiou",*dest->oper) ? "an" : "a"),irc::Spacify(dest->oper), ServerInstance->Config->Network); + ServerInstance->SendWhoisLine(user, dest, 313, "%s %s :is %s %s on %s",user->nick.c_str(), dest->nick.c_str(), (strchr("AEIOUaeiou",dest->oper[0]) ? "an" : "a"),irc::Spacify(dest->oper.c_str()), ServerInstance->Config->Network); } if (user == dest || IS_OPER(user)) { if (dest->modes[UM_SNOMASK] != 0) { - ServerInstance->SendWhoisLine(user, dest, 379, "%s %s :is using modes +%s +%s", user->nick, dest->nick, dest->FormatModes(), dest->FormatNoticeMasks()); + ServerInstance->SendWhoisLine(user, dest, 379, "%s %s :is using modes +%s +%s", user->nick.c_str(), dest->nick.c_str(), dest->FormatModes(), dest->FormatNoticeMasks()); } else { - ServerInstance->SendWhoisLine(user, dest, 379, "%s %s :is using modes +%s", user->nick, dest->nick, dest->FormatModes()); + ServerInstance->SendWhoisLine(user, dest, 379, "%s %s :is using modes +%s", user->nick.c_str(), dest->nick.c_str(), dest->FormatModes()); } } @@ -84,15 +84,15 @@ void do_whois(InspIRCd* ServerInstance, User* user, User* dest,unsigned long sig */ if ((idle) || (signon)) { - ServerInstance->SendWhoisLine(user, dest, 317, "%s %s %lu %lu :seconds idle, signon time",user->nick, dest->nick, idle, signon); + ServerInstance->SendWhoisLine(user, dest, 317, "%s %s %lu %lu :seconds idle, signon time",user->nick.c_str(), dest->nick.c_str(), idle, signon); } - ServerInstance->SendWhoisLine(user, dest, 318, "%s %s :End of /WHOIS list.",user->nick, dest->nick); + ServerInstance->SendWhoisLine(user, dest, 318, "%s %s :End of /WHOIS list.",user->nick.c_str(), dest->nick.c_str()); } else { - ServerInstance->SendWhoisLine(user, dest, 401, "%s %s :No such nick/channel",user->nick, *nick ? nick : "*"); - ServerInstance->SendWhoisLine(user, dest, 318, "%s %s :End of /WHOIS list.",user->nick, *nick ? nick : "*"); + ServerInstance->SendWhoisLine(user, dest, 401, "%s %s :No such nick/channel",user->nick.c_str(), *nick ? nick : "*"); + ServerInstance->SendWhoisLine(user, dest, 318, "%s %s :End of /WHOIS list.",user->nick.c_str(), *nick ? nick : "*"); } } @@ -146,8 +146,8 @@ CmdResult CommandWhois::Handle (const std::vector<std::string>& parameters, User else { /* no such nick/channel */ - user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick, !parameters[userindex].empty() ? parameters[userindex].c_str() : "*"); - user->WriteNumeric(318, "%s %s :End of /WHOIS list.",user->nick, parameters[userindex].empty() ? parameters[userindex].c_str() : "*"); + user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick.c_str(), !parameters[userindex].empty() ? parameters[userindex].c_str() : "*"); + user->WriteNumeric(318, "%s %s :End of /WHOIS list.",user->nick.c_str(), parameters[userindex].empty() ? parameters[userindex].c_str() : "*"); return CMD_FAILURE; } diff --git a/src/commands/cmd_whowas.cpp b/src/commands/cmd_whowas.cpp index 8bc188eee..efd15e3d6 100644 --- a/src/commands/cmd_whowas.cpp +++ b/src/commands/cmd_whowas.cpp @@ -33,7 +33,7 @@ CmdResult CommandWhowas::Handle (const std::vector<std::string>& parameters, Use /* if whowas disabled in config */ if (ServerInstance->Config->WhoWasGroupSize == 0 || ServerInstance->Config->WhoWasMaxGroups == 0) { - user->WriteNumeric(421, "%s %s :This command has been disabled.",user->nick,command.c_str()); + user->WriteNumeric(421, "%s %s :This command has been disabled.",user->nick.c_str(),command.c_str()); return CMD_FAILURE; } @@ -41,8 +41,8 @@ CmdResult CommandWhowas::Handle (const std::vector<std::string>& parameters, Use if (i == whowas.end()) { - user->WriteNumeric(406, "%s %s :There was no such nickname",user->nick,parameters[0].c_str()); - user->WriteNumeric(369, "%s %s :End of WHOWAS",user->nick,parameters[0].c_str()); + user->WriteNumeric(406, "%s %s :There was no such nickname",user->nick.c_str(),parameters[0].c_str()); + user->WriteNumeric(369, "%s %s :End of WHOWAS",user->nick.c_str(),parameters[0].c_str()); return CMD_FAILURE; } else @@ -63,26 +63,26 @@ CmdResult CommandWhowas::Handle (const std::vector<std::string>& parameters, Use strlcpy(b,asctime(timeinfo),MAXBUF); b[24] = 0; - user->WriteNumeric(314, "%s %s %s %s * :%s",user->nick,parameters[0].c_str(),u->ident,u->dhost,u->gecos); + user->WriteNumeric(314, "%s %s %s %s * :%s",user->nick.c_str(),parameters[0].c_str(),u->ident,u->dhost,u->gecos); if (IS_OPER(user)) - user->WriteNumeric(379, "%s %s :was connecting from *@%s", user->nick, parameters[0].c_str(), u->host); + user->WriteNumeric(379, "%s %s :was connecting from *@%s", user->nick.c_str(), parameters[0].c_str(), u->host); if (*ServerInstance->Config->HideWhoisServer && !IS_OPER(user)) - user->WriteNumeric(312, "%s %s %s :%s",user->nick,parameters[0].c_str(), ServerInstance->Config->HideWhoisServer, b); + user->WriteNumeric(312, "%s %s %s :%s",user->nick.c_str(),parameters[0].c_str(), ServerInstance->Config->HideWhoisServer, b); else - user->WriteNumeric(312, "%s %s %s :%s",user->nick,parameters[0].c_str(), u->server, b); + user->WriteNumeric(312, "%s %s %s :%s",user->nick.c_str(),parameters[0].c_str(), u->server, b); } } else { - user->WriteNumeric(406, "%s %s :There was no such nickname",user->nick,parameters[0].c_str()); - user->WriteNumeric(369, "%s %s :End of WHOWAS",user->nick,parameters[0].c_str()); + user->WriteNumeric(406, "%s %s :There was no such nickname",user->nick.c_str(),parameters[0].c_str()); + user->WriteNumeric(369, "%s %s :End of WHOWAS",user->nick.c_str(),parameters[0].c_str()); return CMD_FAILURE; } } - user->WriteNumeric(369, "%s %s :End of WHOWAS",user->nick,parameters[0].c_str()); + user->WriteNumeric(369, "%s %s :End of WHOWAS",user->nick.c_str(),parameters[0].c_str()); return CMD_SUCCESS; } @@ -138,15 +138,15 @@ void CommandWhowas::AddToWhoWas(User* user) return; } - whowas_users::iterator iter = whowas.find(user->nick); + whowas_users::iterator iter = whowas.find(irc::string(user->nick.c_str())); if (iter == whowas.end()) { whowas_set* n = new whowas_set; WhoWasGroup *a = new WhoWasGroup(user); n->push_back(a); - whowas[user->nick] = n; - whowas_fifo.push_back(std::make_pair(ServerInstance->Time(),user->nick)); + whowas[user->nick.c_str()] = n; + whowas_fifo.push_back(std::make_pair(ServerInstance->Time(),user->nick.c_str())); if ((int)(whowas.size()) > ServerInstance->Config->WhoWasMaxGroups) { @@ -318,10 +318,10 @@ CommandWhowas::~CommandWhowas() WhoWasGroup::WhoWasGroup(User* user) : host(NULL), dhost(NULL), ident(NULL), server(NULL), gecos(NULL), signon(user->signon) { this->host = strdup(user->host); - this->dhost = strdup(user->dhost); - this->ident = strdup(user->ident); + this->dhost = strdup(user->dhost.c_str()); + this->ident = strdup(user->ident.c_str()); this->server = user->server; - this->gecos = strdup(user->fullname); + this->gecos = strdup(user->fullname.c_str()); } WhoWasGroup::~WhoWasGroup() diff --git a/src/commands/cmd_zline.cpp b/src/commands/cmd_zline.cpp index c1951d447..6151d7181 100644 --- a/src/commands/cmd_zline.cpp +++ b/src/commands/cmd_zline.cpp @@ -30,7 +30,7 @@ CmdResult CommandZline::Handle (const std::vector<std::string>& parameters, User { if (target.find('!') != std::string::npos) { - user->WriteServ("NOTICE %s :*** You cannot include a nickname in a zline, a zline must ban only an IP mask",user->nick); + user->WriteServ("NOTICE %s :*** You cannot include a nickname in a zline, a zline must ban only an IP mask",user->nick.c_str()); return CMD_FAILURE; } @@ -62,17 +62,17 @@ CmdResult CommandZline::Handle (const std::vector<std::string>& parameters, User ipaddr++; } } - ZLine* zl = new ZLine(ServerInstance, ServerInstance->Time(), duration, user->nick, parameters[2].c_str(), ipaddr); + ZLine* zl = new ZLine(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), ipaddr); if (ServerInstance->XLines->AddLine(zl,user)) { if (!duration) { - ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent Z-line for %s.",user->nick,target.c_str()); + ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent Z-line for %s.",user->nick.c_str(),target.c_str()); } else { time_t c_requires_crap = duration + ServerInstance->Time(); - ServerInstance->SNO->WriteToSnoMask('x',"%s added timed Z-line for %s, expires on %s",user->nick,target.c_str(), + ServerInstance->SNO->WriteToSnoMask('x',"%s added timed Z-line for %s, expires on %s",user->nick.c_str(),target.c_str(), ServerInstance->TimeString(c_requires_crap).c_str()); } ServerInstance->XLines->ApplyLines(); @@ -80,18 +80,18 @@ CmdResult CommandZline::Handle (const std::vector<std::string>& parameters, User else { delete zl; - user->WriteServ("NOTICE %s :*** Z-Line for %s already exists",user->nick,target.c_str()); + user->WriteServ("NOTICE %s :*** Z-Line for %s already exists",user->nick.c_str(),target.c_str()); } } else { if (ServerInstance->XLines->DelLine(target.c_str(),"Z",user)) { - ServerInstance->SNO->WriteToSnoMask('x',"%s Removed Z-line on %s.",user->nick,target.c_str()); + ServerInstance->SNO->WriteToSnoMask('x',"%s Removed Z-line on %s.",user->nick.c_str(),target.c_str()); } else { - user->WriteServ("NOTICE %s :*** Z-Line %s not found in list, try /stats Z.",user->nick,target.c_str()); + user->WriteServ("NOTICE %s :*** Z-Line %s not found in list, try /stats Z.",user->nick.c_str(),target.c_str()); return CMD_FAILURE; } } |