#include "users.h"
#include "channels.h"
#include "modules.h"
-#include "helperfuncs.h"
+
#include "inspircd.h"
/* $ModDesc: Only opers may create new channels if this module is loaded */
class ModuleRestrictChans : public Module
{
- Server* Srv;
+
std::map<irc::string,int> allowchans;
void ReadConfig()
{
- ConfigReader* MyConf = new ConfigReader();
+ ConfigReader* MyConf = new ConfigReader(ServerInstance);
allowchans.clear();
for (int i = 0; i < MyConf->Enumerate("allowchannel"); i++)
{
}
public:
- ModuleRestrictChans(Server* Me)
+ ModuleRestrictChans(InspIRCd* Me)
: Module::Module(Me)
{
- Srv = Me;
+
ReadConfig();
}
List[I_OnUserPreJoin] = List[I_OnRehash] = 1;
}
- virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname)
+ virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname, std::string &privs)
{
irc::string x = cname;
// user is not an oper and its not in the allow list
{
}
- virtual Module * CreateModule(Server* Me)
+ virtual Module * CreateModule(InspIRCd* Me)
{
return new ModuleRestrictChans(Me);
}