class ModuleOperjoin : public Module
{
- private:
std::string operChan;
std::vector<std::string> operChans;
bool override;
}
public:
- ModuleOperjoin()
+ void init()
{
OnRehash(NULL);
Implementation eventlist[] = { I_OnPostOper, I_OnRehash };
- ServerInstance->Modules->Attach(eventlist, this, 2);
+ ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
}
virtual void OnRehash(User* user)
{
- ConfigReader conf;
+ ConfigTag* tag = ServerInstance->Config->ConfValue("operjoin");
- operChan = conf.ReadValue("operjoin", "channel", 0);
- override = conf.ReadFlag("operjoin", "override", "0", 0);
+ operChan = tag->getString("channel");
+ override = tag->getBool("override", false);
operChans.clear();
if (!operChan.empty())
tokenize(operChan,operChans);
}
- virtual ~ModuleOperjoin()
- {
- }
-
virtual Version GetVersion()
{
return Version("Forces opers to join the specified channel(s) on oper-up", VF_VENDOR);
if (ServerInstance->IsChannel(it->c_str(), ServerInstance->Config->Limits.ChanMax))
Channel::JoinUser(user, it->c_str(), override, "", false, ServerInstance->Time());
- std::string chanList = IS_OPER(user)->getConfig("autojoin");
+ std::string chanList = user->oper->getConfig("autojoin");
if (!chanList.empty())
{
std::vector<std::string> typechans;