X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_channames.cpp;h=fcb2ef6d74d7fda8d38bcfbe0bb34138cb7ca19e;hb=e950f568d0f571e9475aa38177486468714de4d3;hp=29cbdca918daf7ca06700f8c74f10e5b2918f73d;hpb=54d10d53c730ab81ca6464fe2f0e0ecbcd435672;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_channames.cpp b/src/modules/m_channames.cpp index 29cbdca91..fcb2ef6d7 100644 --- a/src/modules/m_channames.cpp +++ b/src/modules/m_channames.cpp @@ -49,17 +49,19 @@ class ModuleChannelNames : public Module NewIsChannelHandler myhandler; caller1 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); } @@ -76,11 +78,11 @@ class ModuleChannelNames : public Module while (c2 != chanvec.rend()) { Channel* c = *c2++; - if (c->IsModeSet('P') && c->GetUserCounter()) + if (c->IsModeSet(permchannelmode) && c->GetUserCounter()) { std::vector modes; modes.push_back(c->name); - modes.push_back("-P"); + modes.push_back(std::string("-") + permchannelmode->GetModeChar()); ServerInstance->Modes->Process(modes, ServerInstance->FakeClient); }