From 0c750c060839f9018ca129bd7456184792ea0dc0 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 21 Jun 2020 04:25:45 +0100 Subject: Move channel logic from InspIRCd to the new ChannelManager class. --- src/channels.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/channels.cpp') diff --git a/src/channels.cpp b/src/channels.cpp index 12c9aeeff..6b885735c 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -37,7 +37,7 @@ Channel::Channel(const std::string &cname, time_t ts) : name(cname) , age(ts) { - if (!ServerInstance->chanlist.emplace(cname, this).second) + if (!ServerInstance->Channels.GetChans().emplace(cname, this).second) throw CoreException("Cannot create duplicate channel " + cname); } @@ -94,12 +94,12 @@ void Channel::CheckDestroy() return; // If the channel isn't in chanlist then it is already in the cull list, don't add it again - chan_hash::iterator iter = ServerInstance->chanlist.find(this->name); - if ((iter == ServerInstance->chanlist.end()) || (iter->second != this)) + ChannelMap::iterator iter = ServerInstance->Channels.GetChans().find(this->name); + if ((iter == ServerInstance->Channels.GetChans().end()) || (iter->second != this)) return; FOREACH_MOD(OnChannelDelete, (this)); - ServerInstance->chanlist.erase(iter); + ServerInstance->Channels.GetChans().erase(iter); ServerInstance->GlobalCulls.AddItem(this); } @@ -197,7 +197,7 @@ Channel* Channel::JoinUser(LocalUser* user, std::string cname, bool override, co if (cname.length() > ServerInstance->Config->Limits.MaxChannel) cname.resize(ServerInstance->Config->Limits.MaxChannel); - Channel* chan = ServerInstance->FindChan(cname); + Channel* chan = ServerInstance->Channels.Find(cname); bool created_by_local = (chan == NULL); // Flag that will be passed to modules in the OnUserJoin() hook later std::string privs; // Prefix mode(letter)s to give to the joining user -- cgit v1.3.1-10-gc9f91