From 19283511132c09a208c981f13d54828e775ab611 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Fri, 5 Sep 2014 15:20:44 +0200 Subject: m_samode Simplify command handler logic --- src/modules/m_samode.cpp | 8 +++----- 1 file 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; } -- cgit v1.2.3