diff options
author | Attila Molnar <attilamolnar@hush.com> | 2015-12-07 10:17:49 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2015-12-07 10:17:49 +0100 |
commit | 6352a6f9c9685c32ec17a7d6f9f89df0e3ec3054 (patch) | |
tree | ccc1e0d306c317a55d5c61ead43395efe2c6092b | |
parent | 6bc4db5e922dd49a46684c9b4e417cac36a71942 (diff) |
Remove some IS_SERVER() checks
- InspIRCd::FindUUID() and FindNick() no longer return FakeUsers so checking the user returned from those methods is needless
- m_dccallow is calling FindNickOnly() so it had the check needlessly
-rw-r--r-- | src/coremods/core_oper/cmd_kill.cpp | 2 | ||||
-rw-r--r-- | src/coremods/core_user/cmd_mode.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_callerid.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_dccallow.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_saquit.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_sasl.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/idle.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/metadata.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/save.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_swhois.cpp | 2 |
10 files changed, 11 insertions, 11 deletions
diff --git a/src/coremods/core_oper/cmd_kill.cpp b/src/coremods/core_oper/cmd_kill.cpp index b60885c64..e6b41382c 100644 --- a/src/coremods/core_oper/cmd_kill.cpp +++ b/src/coremods/core_oper/cmd_kill.cpp @@ -44,7 +44,7 @@ CmdResult CommandKill::Handle (const std::vector<std::string>& parameters, User } User *u = ServerInstance->FindNick(parameters[0]); - if ((u) && (!IS_SERVER(u))) + if (u) { /* * Here, we need to decide how to munge kill messages. Whether to hide killer, what to show opers, etc. diff --git a/src/coremods/core_user/cmd_mode.cpp b/src/coremods/core_user/cmd_mode.cpp index 190983d13..a62bf51ca 100644 --- a/src/coremods/core_user/cmd_mode.cpp +++ b/src/coremods/core_user/cmd_mode.cpp @@ -43,7 +43,7 @@ CmdResult CommandMode::Handle(const std::vector<std::string>& parameters, User* targetuser = ServerInstance->FindNick(target); } - if ((!targetchannel) && ((!targetuser) || (IS_SERVER(targetuser)))) + if ((!targetchannel) && (!targetuser)) { user->WriteNumeric(ERR_NOSUCHNICK, "%s :No such nick/channel", target.c_str()); return CMD_FAILURE; diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp index 26b9d0da2..c844ef04f 100644 --- a/src/modules/m_callerid.cpp +++ b/src/modules/m_callerid.cpp @@ -98,7 +98,7 @@ struct CallerIDExtInfo : public ExtensionItem while (s.GetToken(tok)) { User *u = ServerInstance->FindNick(tok); - if ((u) && (u->registered == REG_ALL) && (!u->quitting) && (!IS_SERVER(u))) + if ((u) && (u->registered == REG_ALL) && (!u->quitting)) { if (dat->accepting.insert(u).second) { @@ -170,7 +170,7 @@ class CommandAccept : public Command else target = ServerInstance->FindNickOnly(tok); - if ((!target) || (target->registered != REG_ALL) || (target->quitting) || (IS_SERVER(target))) + if ((!target) || (target->registered != REG_ALL) || (target->quitting)) target = NULL; return std::make_pair(target, !remove); diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index f011fa449..93fddf813 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -104,7 +104,7 @@ class CommandDccallow : public Command std::string nick(parameters[0], 1); User *target = ServerInstance->FindNickOnly(nick); - if ((target) && (!IS_SERVER(target)) && (!target->quitting) && (target->registered == REG_ALL)) + if ((target) && (!target->quitting) && (target->registered == REG_ALL)) { if (action == '-') diff --git a/src/modules/m_saquit.cpp b/src/modules/m_saquit.cpp index aa6aa0180..fb1c67564 100644 --- a/src/modules/m_saquit.cpp +++ b/src/modules/m_saquit.cpp @@ -35,7 +35,7 @@ class CommandSaquit : public Command CmdResult Handle (const std::vector<std::string>& parameters, User *user) { User* dest = ServerInstance->FindNick(parameters[0]); - if ((dest) && (!IS_SERVER(dest)) && (dest->registered == REG_ALL)) + if ((dest) && (dest->registered == REG_ALL)) { if (dest->server->IsULine()) { diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index 20243370d..d7c97c835 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -254,7 +254,7 @@ class CommandSASL : public Command CmdResult Handle(const std::vector<std::string>& parameters, User *user) { User* target = ServerInstance->FindUUID(parameters[1]); - if ((!target) || (IS_SERVER(target))) + if (!target) { ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "User not found in sasl ENCAP event: %s", parameters[1].c_str()); return CMD_FAILURE; diff --git a/src/modules/m_spanningtree/idle.cpp b/src/modules/m_spanningtree/idle.cpp index 06af4d0fd..ad58e52f0 100644 --- a/src/modules/m_spanningtree/idle.cpp +++ b/src/modules/m_spanningtree/idle.cpp @@ -35,7 +35,7 @@ CmdResult CommandIdle::HandleRemote(RemoteUser* issuer, std::vector<std::string> */ User* target = ServerInstance->FindUUID(params[0]); - if ((!target) || (IS_SERVER(target) || (target->registered != REG_ALL))) + if ((!target) || (target->registered != REG_ALL)) return CMD_FAILURE; LocalUser* localtarget = IS_LOCAL(target); diff --git a/src/modules/m_spanningtree/metadata.cpp b/src/modules/m_spanningtree/metadata.cpp index f758754b4..47c2f8bc5 100644 --- a/src/modules/m_spanningtree/metadata.cpp +++ b/src/modules/m_spanningtree/metadata.cpp @@ -56,7 +56,7 @@ CmdResult CommandMetadata::Handle(User* srcuser, std::vector<std::string>& param else { User* u = ServerInstance->FindUUID(params[0]); - if ((u) && (!IS_SERVER(u))) + if (u) { ExtensionItem* item = ServerInstance->Extensions.GetItem(params[1]); std::string value = params.size() < 3 ? "" : params[2]; diff --git a/src/modules/m_spanningtree/save.cpp b/src/modules/m_spanningtree/save.cpp index a382b8d66..7131b49fe 100644 --- a/src/modules/m_spanningtree/save.cpp +++ b/src/modules/m_spanningtree/save.cpp @@ -29,7 +29,7 @@ CmdResult CommandSave::Handle(User* user, std::vector<std::string>& params) { User* u = ServerInstance->FindUUID(params[0]); - if ((!u) || (IS_SERVER(u))) + if (!u) return CMD_FAILURE; time_t ts = atol(params[1].c_str()); diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp index e75921a80..80c7ddd3b 100644 --- a/src/modules/m_swhois.cpp +++ b/src/modules/m_swhois.cpp @@ -43,7 +43,7 @@ class CommandSwhois : public Command { User* dest = ServerInstance->FindNick(parameters[0]); - if ((!dest) || (IS_SERVER(dest))) // allow setting swhois using SWHOIS before reg + if (!dest) // allow setting swhois using SWHOIS before reg { user->WriteNumeric(ERR_NOSUCHNICK, "%s :No such nick/channel", parameters[0].c_str()); return CMD_FAILURE; |