]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/mode.cpp
m_spanningtree Set the TS of the uuid nick to the same value on collision
[user/henk/code/inspircd.git] / src / mode.cpp
index b56c26990a2cc6ddb39e81b60d4d7116ce959c1b..7deeb9b3227740b97ac7066abedc92b7ff3a7827 100644 (file)
@@ -35,7 +35,7 @@ ModeHandler::ModeHandler(Module* Creator, const std::string& Name, char modelett
 
 CullResult ModeHandler::cull()
 {
-       if (ServerInstance->Modes)
+       if (ServerInstance)
                ServerInstance->Modes->DelMode(this);
        return classbase::cull();
 }
@@ -693,15 +693,20 @@ bool ModeParser::DelMode(ModeHandler* mh)
        switch (mh->GetModeType())
        {
                case MODETYPE_USER:
-                       for (user_hash::iterator i = ServerInstance->Users->clientlist->begin(); i != ServerInstance->Users->clientlist->end(); )
+               {
+                       const user_hash& users = ServerInstance->Users->GetUsers();
+                       for (user_hash::const_iterator i = users.begin(); i != users.end(); )
                        {
                                User* user = i->second;
                                ++i;
                                mh->RemoveMode(user);
                        }
+               }
                break;
                case MODETYPE_CHANNEL:
-                       for (chan_hash::iterator i = ServerInstance->chanlist->begin(); i != ServerInstance->chanlist->end(); )
+               {
+                       const chan_hash& chans = ServerInstance->GetChans();
+                       for (chan_hash::const_iterator i = chans.begin(); i != chans.end(); )
                        {
                                // The channel may not be in the hash after RemoveMode(), see m_permchannels
                                Channel* chan = i->second;
@@ -718,6 +723,7 @@ bool ModeParser::DelMode(ModeHandler* mh)
                                        stackresult.erase(stackresult.begin() + 1, stackresult.end());
                                }
                        }
+               }
                break;
        }
 
@@ -909,8 +915,8 @@ void ModeHandler::RemoveMode(Channel* channel, irc::modestacker& stack)
 
 void PrefixMode::RemoveMode(Channel* chan, irc::modestacker& stack)
 {
-       const UserMembList* userlist = chan->GetUsers();
-       for (UserMembCIter i = userlist->begin(); i != userlist->end(); ++i)
+       const Channel::MemberMap& userlist = chan->GetUsers();
+       for (Channel::MemberMap::const_iterator i = userlist.begin(); i != userlist.end(); ++i)
        {
                if (i->second->hasMode(this->GetModeChar()))
                        stack.Push(this->GetModeChar(), i->first->nick);
@@ -933,7 +939,6 @@ struct builtin_modes
        ModeChannelOp o;
        ModeChannelVoice v;
 
-       ModeUserWallops uw;
        ModeUserInvisible ui;
        ModeUserOperator uo;
        ModeUserServerNoticeMask us;
@@ -941,7 +946,7 @@ struct builtin_modes
        void init()
        {
                ServiceProvider* modes[] = { &s, &p, &m, &t, &n, &i, &k, &l, &b, &o, &v,
-                                                                        &uw, &ui, &uo, &us };
+                                                                        &ui, &uo, &us };
                ServerInstance->Modules->AddServices(modes, sizeof(modes)/sizeof(ServiceProvider*));
        }
 };