X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_channames.cpp;h=c5315b3077d446e9848d2fe90260a0e162589fbc;hb=e2b0f3dc9ef4d56c71d7abda13e6139ca092e387;hp=1fb5b2a409324795c2439e3261c77a0b2294cc01;hpb=f62654a6859998f9d63eb22702c572d5ebcff15c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_channames.cpp b/src/modules/m_channames.cpp index 1fb5b2a40..c5315b307 100644 --- a/src/modules/m_channames.cpp +++ b/src/modules/m_channames.cpp @@ -1,6 +1,11 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2013, 2017 Sadie Powell + * Copyright (C) 2013 Daniel Vassdal + * Copyright (C) 2012-2014 Attila Molnar + * Copyright (C) 2012 Robby + * Copyright (C) 2010 Craig Edwards * Copyright (C) 2009-2010 Daniel De Graaf * * This file is part of InspIRCd. InspIRCd is free software: you can @@ -21,10 +26,10 @@ static std::bitset<256> allowedmap; -class NewIsChannelHandler : public HandlerBase1 +class NewIsChannelHandler { public: - bool Call(const std::string&); + static bool Call(const std::string&); }; bool NewIsChannelHandler::Call(const std::string& channame) @@ -44,8 +49,7 @@ bool NewIsChannelHandler::Call(const std::string& channame) class ModuleChannelNames : public Module { - NewIsChannelHandler myhandler; - caller1 rememberer; + TR1NS::function rememberer; bool badchan; ChanModeReference permchannelmode; @@ -59,11 +63,13 @@ class ModuleChannelNames : public Module void init() CXX11_OVERRIDE { - ServerInstance->IsChannel = &myhandler; + ServerInstance->IsChannel = NewIsChannelHandler::Call; } void ValidateChans() { + Modes::ChangeList removepermchan; + badchan = true; const chan_hash& chans = ServerInstance->GetChans(); for (chan_hash::const_iterator i = chans.begin(); i != chans.end(); ) @@ -76,12 +82,11 @@ class ModuleChannelNames : public Module if (c->IsModeSet(permchannelmode) && c->GetUserCounter()) { - std::vector modes; - modes.push_back(c->name); - modes.push_back(std::string("-") + permchannelmode->GetModeChar()); - - ServerInstance->Modes->Process(modes, ServerInstance->FakeClient); + removepermchan.clear(); + removepermchan.push_remove(*permchannelmode); + ServerInstance->Modes->Process(ServerInstance->FakeClient, c, NULL, removepermchan); } + Channel::MemberMap& users = c->userlist; for (Channel::MemberMap::iterator j = users.begin(); j != users.end(); ) { @@ -148,7 +153,7 @@ class ModuleChannelNames : public Module Version GetVersion() CXX11_OVERRIDE { - return Version("Implements config tags which allow changing characters allowed in channel names", VF_VENDOR); + return Version("Allows the server administrator to define what characters are allowed in channel names.", VF_VENDOR); } };