/*
* InspIRCd -- Internet Relay Chat Daemon
*
+ * Copyright (C) 2013, 2017 Sadie Powell <sadie@witchery.services>
+ * Copyright (C) 2013 Daniel Vassdal <shutter@canternet.org>
+ * Copyright (C) 2012-2014 Attila Molnar <attilamolnar@hush.com>
+ * Copyright (C) 2012 Robby <robby@chatbelgie.be>
+ * Copyright (C) 2010 Craig Edwards <brain@inspircd.org>
* Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
*
* This file is part of InspIRCd. InspIRCd is free software: you can
static std::bitset<256> allowedmap;
-class NewIsChannelHandler : public HandlerBase1<bool, const std::string&>
+class NewIsChannelHandler
{
public:
- bool Call(const std::string&);
+ static bool Call(const std::string&);
};
bool NewIsChannelHandler::Call(const std::string& channame)
class ModuleChannelNames : public Module
{
- NewIsChannelHandler myhandler;
- caller1<bool, const std::string&> rememberer;
+ TR1NS::function<bool(const std::string&)> rememberer;
bool badchan;
ChanModeReference permchannelmode;
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(); )
if (c->IsModeSet(permchannelmode) && c->GetUserCounter())
{
- std::vector<std::string> 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 (UserMembIter j = users.begin(); j != users.end(); )
+ for (Channel::MemberMap::iterator j = users.begin(); j != users.end(); )
{
if (IS_LOCAL(j->first))
{
// KickUser invalidates the iterator
- UserMembIter it = j++;
+ Channel::MemberMap::iterator it = j++;
c->KickUser(ServerInstance->FakeClient, it, "Channel name no longer valid");
}
else
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);
}
};