From f610b723f0b45cf7e4f478f0676ed97c3a23d78c Mon Sep 17 00:00:00 2001 From: w00t Date: Tue, 29 Jul 2008 16:36:10 +0000 Subject: Move umode_n to umode_s, second half of last commit git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10075 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modes/Makefile | 8 ++++---- src/modes/umode_n.cpp | 53 --------------------------------------------------- src/modes/umode_s.cpp | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 57 deletions(-) delete mode 100644 src/modes/umode_n.cpp create mode 100644 src/modes/umode_s.cpp (limited to 'src/modes') diff --git a/src/modes/Makefile b/src/modes/Makefile index 682e554b5..65a7dfe16 100644 --- a/src/modes/Makefile +++ b/src/modes/Makefile @@ -1,7 +1,7 @@ CC = i am cornholio CXXFLAGS = -I../../include ${FLAGS} -all: umode_w.o umode_o.o umode_n.o umode_i.o cmode_v.o cmode_t.o cmode_s.o cmode_p.o cmode_o.o cmode_n.o cmode_m.o cmode_l.o cmode_k.o cmode_i.o cmode_h.o cmode_b.o modeclasses.a +all: umode_w.o umode_o.o umode_s.o umode_i.o cmode_v.o cmode_t.o cmode_s.o cmode_p.o cmode_o.o cmode_n.o cmode_m.o cmode_l.o cmode_k.o cmode_i.o cmode_h.o cmode_b.o modeclasses.a umode_w.o: umode_w.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c umode_w.cpp @@ -9,8 +9,8 @@ umode_w.o: umode_w.cpp ../../include/base.h ../../include/modules.h ../../includ umode_o.o: umode_o.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c umode_o.cpp -umode_n.o: umode_n.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h - @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c umode_n.cpp +umode_s.o: umode_s.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h + @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c umode_s.cpp umode_i.o: umode_i.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c umode_i.cpp @@ -51,7 +51,7 @@ cmode_h.o: cmode_h.cpp ../../include/base.h ../../include/modules.h ../../includ cmode_b.o: cmode_b.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_b.cpp -modeclasses.a: umode_w.o umode_o.o umode_n.o umode_i.o cmode_v.o cmode_t.o cmode_s.o cmode_p.o cmode_o.o cmode_n.o cmode_m.o cmode_l.o cmode_k.o cmode_i.o cmode_h.o cmode_b.o +modeclasses.a: umode_w.o umode_o.o umode_s.o umode_i.o cmode_v.o cmode_t.o cmode_s.o cmode_p.o cmode_o.o cmode_n.o cmode_m.o cmode_l.o cmode_k.o cmode_i.o cmode_h.o cmode_b.o @-rm -rf modeclasses.a @../../make/run-cc.pl ar crs modeclasses.a *.o diff --git a/src/modes/umode_n.cpp b/src/modes/umode_n.cpp deleted file mode 100644 index 878de8097..000000000 --- a/src/modes/umode_n.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* +------------------------------------+ - * | Inspire Internet Relay Chat Daemon | - * +------------------------------------+ - * - * InspIRCd: (C) 2002-2008 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits - * - * This program is free but copyrighted software; see - * the file COPYING for details. - * - * --------------------------------------------------- - */ - -#include "inspircd.h" -#include "mode.h" -#include "channels.h" -#include "users.h" -#include "modes/umode_n.h" - -ModeUserServerNoticeMask::ModeUserServerNoticeMask(InspIRCd* Instance) : ModeHandler(Instance, 's', 1, 0, false, MODETYPE_USER, true) -{ -} - -ModeAction ModeUserServerNoticeMask::OnModeChange(User* source, User* dest, Channel*, std::string ¶meter, bool adding, bool servermode) -{ - /* Only opers can change other users modes */ - if ((source != dest) && (!IS_OPER(source))) - return MODEACTION_DENY; - - /* Set the array fields */ - if (adding) - { - /* Fix for bug #310 reported by Smartys */ - if (!dest->modes[UM_SNOMASK]) - dest->snomasks.reset(); - - parameter = dest->ProcessNoticeMasks(parameter.c_str()); - dest->modes[UM_SNOMASK] = true; - return MODEACTION_ALLOW; - } - else - { - if (dest->modes[UM_SNOMASK] != false) - { - dest->modes[UM_SNOMASK] = false; - return MODEACTION_ALLOW; - } - } - - /* Allow the change */ - return MODEACTION_DENY; -} - diff --git a/src/modes/umode_s.cpp b/src/modes/umode_s.cpp new file mode 100644 index 000000000..3a70161d5 --- /dev/null +++ b/src/modes/umode_s.cpp @@ -0,0 +1,53 @@ +/* +------------------------------------+ + * | Inspire Internet Relay Chat Daemon | + * +------------------------------------+ + * + * InspIRCd: (C) 2002-2008 InspIRCd Development Team + * See: http://www.inspircd.org/wiki/index.php/Credits + * + * This program is free but copyrighted software; see + * the file COPYING for details. + * + * --------------------------------------------------- + */ + +#include "inspircd.h" +#include "mode.h" +#include "channels.h" +#include "users.h" +#include "modes/umode_s.h" + +ModeUserServerNoticeMask::ModeUserServerNoticeMask(InspIRCd* Instance) : ModeHandler(Instance, 's', 1, 0, false, MODETYPE_USER, true) +{ +} + +ModeAction ModeUserServerNoticeMask::OnModeChange(User* source, User* dest, Channel*, std::string ¶meter, bool adding, bool servermode) +{ + /* Only opers can change other users modes */ + if ((source != dest) && (!IS_OPER(source))) + return MODEACTION_DENY; + + /* Set the array fields */ + if (adding) + { + /* Fix for bug #310 reported by Smartys */ + if (!dest->modes[UM_SNOMASK]) + dest->snomasks.reset(); + + parameter = dest->ProcessNoticeMasks(parameter.c_str()); + dest->modes[UM_SNOMASK] = true; + return MODEACTION_ALLOW; + } + else + { + if (dest->modes[UM_SNOMASK] != false) + { + dest->modes[UM_SNOMASK] = false; + return MODEACTION_ALLOW; + } + } + + /* Allow the change */ + return MODEACTION_DENY; +} + -- cgit v1.2.3