From da185282a4606a84cd39ef0d47cd2b9f6e28f94d Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 24 Jan 2006 17:04:40 +0000 Subject: Added code to remove +r on a nick if they have it and change nicks git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2880 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_services.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/modules/m_services.cpp b/src/modules/m_services.cpp index 7eed797e9..a35731370 100644 --- a/src/modules/m_services.cpp +++ b/src/modules/m_services.cpp @@ -63,7 +63,19 @@ class ModuleServices : public Module void Implements(char* List) { - List[I_OnUserPreMessage] = List[I_OnExtendedMode] = List[I_On005Numeric] = List[I_OnUserPreNotice] = List[I_OnUserPreJoin] = 1; + List[I_OnUserPostNick] = List[I_OnUserPreMessage] = List[I_OnExtendedMode] = List[I_On005Numeric] = List[I_OnUserPreNotice] = List[I_OnUserPreJoin] = 1; + } + + virtual void OnUserPostNick(userrec* user, std::string oldnick) + { + /* On nickchange, if they have +r, remove it */ + if (strchr(user->modes,'r')) + { + char* modechange[2]; + modechange[0] = user->nick; + modechange[1] = "-r"; + Srv->SendMode(modechange,2,user); + } } virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list ¶ms) -- cgit v1.2.3