From 67878d628c15f2adec41b6d3b266830a636c2ed0 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 28 Dec 2006 16:55:50 +0000 Subject: Reasonably sized fix - when adding modes in modules, be sure to check the return value so we dont load two modules with conflicting modes git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6137 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_chanprotect.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/modules/m_chanprotect.cpp') diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp index 9f5a4eba3..cab686372 100644 --- a/src/modules/m_chanprotect.cpp +++ b/src/modules/m_chanprotect.cpp @@ -298,8 +298,8 @@ class ModuleChanProtect : public Module cp = new ChanProtect(ServerInstance,QAPrefixes,DeprivSelf); cf = new ChanFounder(ServerInstance,QAPrefixes,DeprivSelf); - ServerInstance->AddMode(cp, 'a'); - ServerInstance->AddMode(cf, 'q'); + if (!ServerInstance->AddMode(cp, 'a') || !ServerInstance->AddMode(cf, 'q')) + throw ModuleException("Could not add new modes!"); } void Implements(char* List) @@ -348,6 +348,7 @@ class ModuleChanProtect : public Module DELETE(cf); cp = new ChanProtect(ServerInstance,QAPrefixes,DeprivSelf); cf = new ChanFounder(ServerInstance,QAPrefixes,DeprivSelf); + /* These wont fail, we already owned the mode characters before */ 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."); -- cgit v1.2.3