From e1cc6b33f4e5510f65d8cfeb62b0f31d567e1bbf Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 19 Apr 2003 12:41:44 +0000 Subject: Added more code for custom channel/user modes via modules git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@175 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src/inspircd.cpp') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 621ca21c5..79e3c8b73 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -1892,6 +1892,37 @@ void process_modes(char **parameters,userrec* user,chanrec *chan,int status, int chan->c_private = mdir; break; + default: + string_list p; + p.clear(); + if (ModeDefined(modelist[ptr],MT_CHANNEL)) + { + if ((ModeDefinedOn(modelist[ptr],MT_CHANNEL)>0) && (mdir)) + { + p.push_back(parameters[param]); + } + if ((ModeDefinedOff(modelist[ptr],MT_CHANNEL)>0) && (!mdir)) + { + p.push_back(parameters[param]); + } + for (int i = 0; i <= MODCOUNT; i++) + { + if (modules[i]->OnExtendedMode(user,chan,modechar,MT_CHANNEL,mdir,p)) + { + strcat(outlist,modelist[ptr]); + chan->SetCustomMode(modelist[ptr],mdir); + // include parameters in output if mode has them + if ((ModeDefinedOn(modelist[ptr],MT_CHANNEL)>0) || + (ModeDefinedOff(modelist[ptr],MT_CHANNEL)>0)) + { + chan->SetCustomModeParam(modelist[ptr],parameters[param],mdir); + strcpy(outpars[pc++],parameters[param++]); + } + } + } + } + break; + } } } -- cgit v1.2.3