summaryrefslogtreecommitdiff
path: root/src/modules/m_chanprotect.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_chanprotect.cpp')
-rw-r--r--src/modules/m_chanprotect.cpp5
1 files changed, 3 insertions, 2 deletions
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.");