diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-09-05 15:20:44 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-09-05 15:20:44 +0200 |
commit | 19283511132c09a208c981f13d54828e775ab611 (patch) | |
tree | 79cb9eddfdc34a84d6b1809517ff47197e5060ec | |
parent | 706b5a5a5bebb7fb25f2ec91a9fe48837ec200c8 (diff) |
m_samode Simplify command handler logic
-rw-r--r-- | src/modules/m_samode.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/modules/m_samode.cpp b/src/modules/m_samode.cpp index caf1f27c4..b56f7ae95 100644 --- a/src/modules/m_samode.cpp +++ b/src/modules/m_samode.cpp @@ -45,11 +45,9 @@ class CommandSamode : public Command user->WriteNumeric(ERR_NOSUCHNICK, "%s %s :No such nick/channel", user->nick.c_str(), parameters[0].c_str()); return CMD_FAILURE; } - } - User* target = ServerInstance->FindNick(parameters[0]); - if ((target) && (target != user)) - { - if (!user->HasPrivPermission("users/samode-usermodes", true)) + + // Changing the modes of another user requires a special permission + if ((target != user) && (!user->HasPrivPermission("users/samode-usermodes", true))) return CMD_FAILURE; } |