* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
- * E-mail:
- * <brain@chatspike.net>
- * <Craig@chatspike.net>
- *
- * Written by Craig Edwards, Craig McLure, and others.
+ * InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
+ *
* This program is free but copyrighted software; see
- * the file COPYING for details.
+ * the file COPYING for details.
*
* ---------------------------------------------------
*/
{
char* dummyptr;
public:
- ChanFounder(InspIRCd* Instance, bool using_prefixes, bool depriv_self)
+ ChanFounder(InspIRCd* Instance, bool using_prefixes, bool &depriv_self)
: ModeHandler(Instance, 'q', 1, 1, true, MODETYPE_CHANNEL, false, using_prefixes ? '~' : 0),
FounderProtectBase(Instance, "cm_founder_", "founder", 386, 387, depriv_self) { }
{
char* dummyptr;
public:
- ChanProtect(InspIRCd* Instance, bool using_prefixes, bool depriv_self)
+ ChanProtect(InspIRCd* Instance, bool using_prefixes, bool &depriv_self)
: ModeHandler(Instance, 'a', 1, 1, true, MODETYPE_CHANNEL, false, using_prefixes ? '&' : 0),
FounderProtectBase(Instance,"cm_protect_","protected user", 388, 389, depriv_self) { }
: Module::Module(Me), FirstInGetsFounder(false), QAPrefixes(false), DeprivSelf(false), booting(true)
{
/* Load config stuff */
- OnRehash("");
+ OnRehash(NULL,"");
booting = false;
/* Initialise module variables */
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)
user->Shrink("cm_protect_"+std::string(channel->name));
}
- virtual void OnRehash(const std::string ¶meter)
+ virtual void OnRehash(userrec* user, const std::string ¶meter)
{
/* Create a configreader class and read our flag,
* in old versions this was heap-allocated and the
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.");