From 0376f1d8be09a242befe207be4fa9e809d098557 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 1 May 2008 19:56:16 +0000 Subject: Convert to SimpleUserModeHandler and SimpleChannelModeHandler git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9599 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modes/umode_i.cpp | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'src/modes/umode_i.cpp') diff --git a/src/modes/umode_i.cpp b/src/modes/umode_i.cpp index 493687ea7..e7a4a8e11 100644 --- a/src/modes/umode_i.cpp +++ b/src/modes/umode_i.cpp @@ -17,27 +17,10 @@ #include "users.h" #include "modes/umode_i.h" -ModeUserInvisible::ModeUserInvisible(InspIRCd* Instance) : ModeHandler(Instance, 'i', 0, 0, false, MODETYPE_USER, false) +ModeUserInvisible::ModeUserInvisible(InspIRCd* Instance) : SimpleUserModeHandler(Instance, 'i') { } -ModeAction ModeUserInvisible::OnModeChange(User* source, User* dest, Channel*, std::string&, bool adding, bool servermode) -{ - /* Only opers can change other users modes */ - if ((source != dest) && (!*source->oper)) - return MODEACTION_DENY; - - /* Set the bitfields */ - if (dest->modes[UM_INVISIBLE] != adding) - { - dest->modes[UM_INVISIBLE] = adding; - return MODEACTION_ALLOW; - } - - /* Allow the change */ - return MODEACTION_DENY; -} - unsigned int ModeUserInvisible::GetCount() { return count; -- cgit v1.2.3