#include "inspircd.h"
-/* $ModDesc: Implements config tags which allow changing characters allowed in channel names */
-
static std::bitset<256> allowedmap;
class NewIsChannelHandler : public HandlerBase1<bool, const std::string&>
NewIsChannelHandler myhandler;
caller1<bool, const std::string&> rememberer;
bool badchan;
+ ChanModeReference permchannelmode;
public:
- ModuleChannelNames() : rememberer(ServerInstance->IsChannel), badchan(false)
+ ModuleChannelNames()
+ : rememberer(ServerInstance->IsChannel)
+ , badchan(false)
+ , permchannelmode(this, "permanent")
{
}
void init() CXX11_OVERRIDE
{
ServerInstance->IsChannel = &myhandler;
- Implementation eventlist[] = { I_OnRehash, I_OnUserKick };
- ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
OnRehash(NULL);
}
while (c2 != chanvec.rend())
{
Channel* c = *c2++;
- if (c->IsModeSet('P') && c->GetUserCounter())
+ if (c->IsModeSet(permchannelmode) && c->GetUserCounter())
{
std::vector<std::string> modes;
modes.push_back(c->name);
- modes.push_back("-P");
+ modes.push_back(std::string("-") + permchannelmode->GetModeChar());
ServerInstance->Modes->Process(modes, ServerInstance->FakeClient);
}