diff options
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/cmd_die.cpp | 2 | ||||
-rw-r--r-- | src/commands/cmd_eline.cpp | 2 | ||||
-rw-r--r-- | src/commands/cmd_gline.cpp | 3 | ||||
-rw-r--r-- | src/commands/cmd_kline.cpp | 3 | ||||
-rw-r--r-- | src/commands/cmd_notice.cpp | 5 | ||||
-rw-r--r-- | src/commands/cmd_oper.cpp | 3 | ||||
-rw-r--r-- | src/commands/cmd_part.cpp | 2 | ||||
-rw-r--r-- | src/commands/cmd_privmsg.cpp | 9 | ||||
-rw-r--r-- | src/commands/cmd_reloadmodule.cpp | 2 | ||||
-rw-r--r-- | src/commands/cmd_stats.cpp | 14 | ||||
-rw-r--r-- | src/commands/cmd_userhost.cpp | 1 | ||||
-rw-r--r-- | src/commands/cmd_who.cpp | 9 | ||||
-rw-r--r-- | src/commands/cmd_whowas.cpp | 8 | ||||
-rw-r--r-- | src/commands/cmd_zline.cpp | 2 |
14 files changed, 29 insertions, 36 deletions
diff --git a/src/commands/cmd_die.cpp b/src/commands/cmd_die.cpp index 7d9204fe6..9f1bf4591 100644 --- a/src/commands/cmd_die.cpp +++ b/src/commands/cmd_die.cpp @@ -31,7 +31,7 @@ CmdResult CommandDie::Handle (const std::vector<std::string>& parameters, User * ServerInstance->Logs->Log("COMMAND",SPARSE, diebuf); ServerInstance->SendError(diebuf); } - + if (ServerInstance->Config->DieDelay) sleep(ServerInstance->Config->DieDelay); diff --git a/src/commands/cmd_eline.cpp b/src/commands/cmd_eline.cpp index 782ef8c45..0a4c32866 100644 --- a/src/commands/cmd_eline.cpp +++ b/src/commands/cmd_eline.cpp @@ -25,7 +25,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) CmdResult CommandEline::Handle (const std::vector<std::string>& parameters, User *user) { std::string target = parameters[0]; - + if (parameters.size() >= 3) { IdentHostPair ih; diff --git a/src/commands/cmd_gline.cpp b/src/commands/cmd_gline.cpp index 18b5fa9ef..ad60b0416 100644 --- a/src/commands/cmd_gline.cpp +++ b/src/commands/cmd_gline.cpp @@ -25,7 +25,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) CmdResult CommandGline::Handle (const std::vector<std::string>& parameters, User *user) { std::string target = parameters[0]; - + if (parameters.size() >= 3) { IdentHostPair ih; @@ -92,4 +92,3 @@ CmdResult CommandGline::Handle (const std::vector<std::string>& parameters, User return CMD_SUCCESS; } - diff --git a/src/commands/cmd_kline.cpp b/src/commands/cmd_kline.cpp index 827951366..691c92444 100644 --- a/src/commands/cmd_kline.cpp +++ b/src/commands/cmd_kline.cpp @@ -38,7 +38,7 @@ CmdResult CommandKline::Handle (const std::vector<std::string>& parameters, User } else ih = ServerInstance->XLines->IdentSplit(target.c_str()); - + if (ih.first.empty()) { user->WriteServ("NOTICE %s :*** Target not found", user->nick.c_str()); @@ -91,4 +91,3 @@ CmdResult CommandKline::Handle (const std::vector<std::string>& parameters, User return CMD_SUCCESS; } - diff --git a/src/commands/cmd_notice.cpp b/src/commands/cmd_notice.cpp index d22bd2fce..3e249b864 100644 --- a/src/commands/cmd_notice.cpp +++ b/src/commands/cmd_notice.cpp @@ -27,7 +27,7 @@ CmdResult CommandNotice::Handle (const std::vector<std::string>& parameters, Use CUList exempt_list; user->idle_lastmsg = ServerInstance->Time(); - + if (ServerInstance->Parser->LoopCall(user, this, parameters, 0)) return CMD_SUCCESS; if (parameters[0][0] == '$') @@ -123,7 +123,7 @@ CmdResult CommandNotice::Handle (const std::vector<std::string>& parameters, Use } return CMD_SUCCESS; } - + const char* destnick = parameters[0].c_str(); if (IS_LOCAL(user)) @@ -185,4 +185,3 @@ CmdResult CommandNotice::Handle (const std::vector<std::string>& parameters, Use return CMD_SUCCESS; } - diff --git a/src/commands/cmd_oper.cpp b/src/commands/cmd_oper.cpp index da07d631c..270306b05 100644 --- a/src/commands/cmd_oper.cpp +++ b/src/commands/cmd_oper.cpp @@ -128,7 +128,7 @@ 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.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.c_str(), user->ident.c_str(), user->host.c_str(), parameters[0].c_str(), fields.c_str()); ServerInstance->SNO->WriteToSnoMask('o',std::string(broadcast)); ServerInstance->PI->SendSNONotice("o", std::string("OPER: ") + broadcast); @@ -150,4 +150,3 @@ CmdResult CommandOper::Handle (const std::vector<std::string>& parameters, User } return CMD_SUCCESS; } - diff --git a/src/commands/cmd_part.cpp b/src/commands/cmd_part.cpp index 54fd13216..d9fbfb595 100644 --- a/src/commands/cmd_part.cpp +++ b/src/commands/cmd_part.cpp @@ -44,7 +44,7 @@ CmdResult CommandPart::Handle (const std::vector<std::string>& parameters, User return CMD_SUCCESS; Channel* c = ServerInstance->FindChan(parameters[0]); - + if (c) { if (!c->PartUser(user, reason)) diff --git a/src/commands/cmd_privmsg.cpp b/src/commands/cmd_privmsg.cpp index 64adafbe8..0ff7661a3 100644 --- a/src/commands/cmd_privmsg.cpp +++ b/src/commands/cmd_privmsg.cpp @@ -26,7 +26,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector<std::string>& parameters, Us CUList except_list; user->idle_lastmsg = ServerInstance->Time(); - + if (ServerInstance->Parser->LoopCall(user, this, parameters, 0)) return CMD_SUCCESS; @@ -120,7 +120,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector<std::string>& parameters, Us chan->WriteAllExcept(user, false, status, except_list, "PRIVMSG %c%s :%s", status, chan->name.c_str(), text); } } - else + else { chan->WriteAllExcept(user, false, status, except_list, "PRIVMSG %s :%s", chan->name.c_str(), text); } @@ -141,7 +141,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector<std::string>& parameters, Us if (IS_LOCAL(user)) { const char* targetserver = strchr(destnick, '@'); - + if (targetserver) { std::string nickonly; @@ -176,7 +176,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector<std::string>& parameters, Us } int MOD_RESULT = 0; - + std::string temp = parameters[1]; FOREACH_RESULT(I_OnUserPreMessage,OnUserPreMessage(user, dest, TYPE_USER, temp, 0, except_list)); if (MOD_RESULT) { @@ -202,4 +202,3 @@ CmdResult CommandPrivmsg::Handle (const std::vector<std::string>& parameters, Us } return CMD_SUCCESS; } - diff --git a/src/commands/cmd_reloadmodule.cpp b/src/commands/cmd_reloadmodule.cpp index ba31dbd3e..6920896d8 100644 --- a/src/commands/cmd_reloadmodule.cpp +++ b/src/commands/cmd_reloadmodule.cpp @@ -31,7 +31,7 @@ CmdResult CommandReloadmodule::Handle (const std::vector<std::string>& parameter return CMD_SUCCESS; } } - + 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_stats.cpp b/src/commands/cmd_stats.cpp index aea34511c..66274c58a 100644 --- a/src/commands/cmd_stats.cpp +++ b/src/commands/cmd_stats.cpp @@ -61,7 +61,7 @@ DllExport void DoStats(InspIRCd* ServerInstance, char statschar, User* user, str results.push_back(sn + " 481 " + user->nick + " :Permission denied - STATS " + statschar + " requires the servers/auspex priv."); return; } - + int MOD_RESULT = 0; FOREACH_RESULT(I_OnStats,OnStats(statschar, user, results)); if (MOD_RESULT) @@ -93,7 +93,7 @@ DllExport void DoStats(InspIRCd* ServerInstance, char statschar, User* user, str case 'n': case 'c': break; - + case 'i': { int idx = 0; @@ -105,7 +105,7 @@ DllExport void DoStats(InspIRCd* ServerInstance, char statschar, User* user, str } } break; - + case 'Y': { int idx = 0; @@ -129,7 +129,7 @@ DllExport void DoStats(InspIRCd* ServerInstance, char statschar, User* user, str } } break; - + case 'P': { int idx = 0; @@ -145,7 +145,7 @@ DllExport void DoStats(InspIRCd* ServerInstance, char statschar, User* user, str results.push_back(sn+" 249 "+user->nick+" :"+ConvToStr(idx)+" OPER(s)"); } break; - + case 'k': ServerInstance->XLines->InvokeStats("K",216,user,results); break; @@ -239,7 +239,7 @@ DllExport void DoStats(InspIRCd* ServerInstance, char statschar, User* user, str timeval tv; char percent[30]; gettimeofday(&tv, NULL); - + float n_elapsed = ((tv.tv_sec - ServerInstance->stats->LastSampled.tv_sec) * 1000000 + tv.tv_usec - ServerInstance->stats->LastSampled.tv_usec); float n_eaten = ((R.ru_utime.tv_sec - ServerInstance->stats->LastCPU.tv_sec) * 1000000 + R.ru_utime.tv_usec - ServerInstance->stats->LastCPU.tv_usec); float per = (n_eaten / n_elapsed) * 100; @@ -259,7 +259,7 @@ DllExport void DoStats(InspIRCd* ServerInstance, char statschar, User* user, str #endif } break; - + case 'T': { char buffer[MAXBUF]; diff --git a/src/commands/cmd_userhost.cpp b/src/commands/cmd_userhost.cpp index 8ed5f606c..40ba937c1 100644 --- a/src/commands/cmd_userhost.cpp +++ b/src/commands/cmd_userhost.cpp @@ -23,7 +23,6 @@ CmdResult CommandUserhost::Handle (const std::vector<std::string>& parameters, U { std::string retbuf = std::string("302 ") + user->nick + " :"; - for (unsigned int i = 0; i < parameters.size(); i++) { User *u = ServerInstance->FindNick(parameters[i]); diff --git a/src/commands/cmd_who.cpp b/src/commands/cmd_who.cpp index 4f44fd518..9ba3c0fc9 100644 --- a/src/commands/cmd_who.cpp +++ b/src/commands/cmd_who.cpp @@ -286,10 +286,10 @@ CmdResult CommandWho::Handle (const std::vector<std::string>& parameters, User * if (CanView(ch,user)) { bool inside = ch->HasUser(user); - + /* who on a channel. */ CUList *cu = ch->GetUsers(); - + for (CUList::iterator i = cu->begin(); i != cu->end(); i++) { /* None of this applies if we WHO ourselves */ @@ -298,12 +298,12 @@ CmdResult CommandWho::Handle (const std::vector<std::string>& parameters, User * /* opers only, please */ if (opt_viewopersonly && !IS_OPER(i->first)) continue; - + /* If we're not inside the channel, hide +i users */ if (i->first->IsModeSet('i') && !inside && !user->HasPrivPermission("users/auspex")) continue; } - + SendWhoLine(user, initial, ch, i->first, whoresults); } } @@ -362,4 +362,3 @@ CmdResult CommandWho::Handle (const std::vector<std::string>& parameters, User * return CMD_FAILURE; } } - diff --git a/src/commands/cmd_whowas.cpp b/src/commands/cmd_whowas.cpp index f15b523c0..6340216f7 100644 --- a/src/commands/cmd_whowas.cpp +++ b/src/commands/cmd_whowas.cpp @@ -56,18 +56,18 @@ CmdResult CommandWhowas::Handle (const std::vector<std::string>& parameters, Use time_t rawtime = u->signon; tm *timeinfo; char b[MAXBUF]; - + timeinfo = localtime(&rawtime); - + /* XXX - 'b' could be only 25 chars long and then strlcpy() would terminate it for us too? */ strlcpy(b,asctime(timeinfo),MAXBUF); b[24] = 0; user->WriteNumeric(314, "%s %s %s %s * :%s",user->nick.c_str(),parameters[0].c_str(),u->ident,u->dhost,u->gecos); - + if (user->HasPrivPermission("users/auspex")) user->WriteNumeric(379, "%s %s :was connecting from *@%s", user->nick.c_str(), parameters[0].c_str(), u->host); - + if (*ServerInstance->Config->HideWhoisServer && !user->HasPrivPermission("servers/auspex")) user->WriteNumeric(312, "%s %s %s :%s",user->nick.c_str(),parameters[0].c_str(), ServerInstance->Config->HideWhoisServer, b); else diff --git a/src/commands/cmd_zline.cpp b/src/commands/cmd_zline.cpp index f275ac313..b0df24a95 100644 --- a/src/commands/cmd_zline.cpp +++ b/src/commands/cmd_zline.cpp @@ -35,7 +35,7 @@ CmdResult CommandZline::Handle (const std::vector<std::string>& parameters, User } User *u = ServerInstance->FindNick(target.c_str()); - + if (u) { target = u->GetIPString(); |