diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-10-27 07:31:17 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-10-27 07:31:17 +0000 |
commit | 2cffac470d02c6c5cf77478a77be0e80144c5dbd (patch) | |
tree | 69062a7954b4dc8279bb1f1586c0c9b9f45387cf | |
parent | 3ea5a27cd34d16c69dc9e2a480a3791de4db0124 (diff) |
Allow changing of qaprefixes on the fly with REHASH - if this happens, writeopers saying that users might need to reconnect to detect the change.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5549 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/modules/m_chanprotect.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp index c3acc4085..a074ef127 100644 --- a/src/modules/m_chanprotect.cpp +++ b/src/modules/m_chanprotect.cpp @@ -325,9 +325,28 @@ class ModuleChanProtect : public Module * stack-allocate it locally. */ ConfigReader Conf(ServerInstance); + + bool old_qa = QAPrefixes; FirstInGetsFounder = Conf.ReadFlag("options","noservices",0); QAPrefixes = Conf.ReadFlag("options","qaprefixes",0); + + /* Did the user change the QA prefixes on the fly? + * If so, remove all instances of the mode, and reinit + * the module with prefixes enabled. + */ + if (old_qa != QAPrefixes) + { + ServerInstance->Modes->DelMode(cp); + ServerInstance->Modes->DelMode(cf); + DELETE(cp); + DELETE(cf); + cp = new ChanProtect(ServerInstance,QAPrefixes); + cf = new ChanFounder(ServerInstance,QAPrefixes); + ServerInstance->AddMode(cp, 'a'); + ServerInstance->AddMode(cf, 'q'); + ServerInstance->WriteOpers("*** WARNING: +qa prefixes were enabled or disabled via a REHASH. Clients will probably need to reconnect to pick up this change."); + } } virtual void OnUserJoin(userrec* user, chanrec* channel) |