]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_check.cpp
Fix a regression in m_cloaking
[user/henk/code/inspircd.git] / src / modules / m_check.cpp
index d7cfe74bd50bf2ff4505aae97b6e426070c9f3a7..8ae30bfed0da5b3e76e823a7e8522aaf93a97b57 100644 (file)
@@ -149,7 +149,7 @@ class CommandCheck : public Command
                                {
                                        std::string umodes;
                                        std::string cmodes;
-                                       for(char c='A'; c < 'z'; c++)
+                                       for(char c='A'; c <= 'z'; c++)
                                        {
                                                ModeHandler* mh = ServerInstance->Modes->FindMode(c, MODETYPE_USER);
                                                if (mh && mh->NeedsOper() && loctarg->HasModePermission(c, MODETYPE_USER))
@@ -160,7 +160,7 @@ class CommandCheck : public Command
                                        }
                                        user->SendText(checkstr + " modeperms user=" + umodes + " channel=" + cmodes);
                                        std::string opcmds;
-                                       for(std::set<std::string>::iterator i = oper->AllowedOperCommands.begin(); i != oper->AllowedOperCommands.end(); i++)
+                                       for (OperInfo::PrivSet::const_iterator i = oper->AllowedOperCommands.begin(); i != oper->AllowedOperCommands.end(); ++i)
                                        {
                                                opcmds.push_back(' ');
                                                opcmds.append(*i);
@@ -168,7 +168,7 @@ class CommandCheck : public Command
                                        std::stringstream opcmddump(opcmds);
                                        user->SendText(checkstr + " commandperms", opcmddump);
                                        std::string privs;
-                                       for(std::set<std::string>::iterator i = oper->AllowedPrivs.begin(); i != oper->AllowedPrivs.end(); i++)
+                                       for (OperInfo::PrivSet::const_iterator i = oper->AllowedPrivs.begin(); i != oper->AllowedPrivs.end(); ++i)
                                        {
                                                privs.push_back(' ');
                                                privs.append(*i);
@@ -190,11 +190,13 @@ class CommandCheck : public Command
                        else
                                user->SendText(checkstr + " onip " + targuser->GetIPString());
 
-                       for (UCListIter i = targuser->chans.begin(); i != targuser->chans.end(); i++)
+                       for (User::ChanList::iterator i = targuser->chans.begin(); i != targuser->chans.end(); i++)
                        {
                                Membership* memb = *i;
                                Channel* c = memb->chan;
-                               chliststr.push_back(memb->GetPrefixChar());
+                               char prefix = memb->GetPrefixChar();
+                               if (prefix)
+                                       chliststr.push_back(prefix);
                                chliststr.append(c->name).push_back(' ');
                        }
 
@@ -222,16 +224,17 @@ class CommandCheck : public Command
 
                        /* now the ugly bit, spool current members of a channel. :| */
 
-                       const UserMembList *ulist= targchan->GetUsers();
+                       const Channel::MemberMap& ulist = targchan->GetUsers();
 
                        /* note that unlike /names, we do NOT check +i vs in the channel */
-                       for (UserMembCIter i = ulist->begin(); i != ulist->end(); i++)
+                       for (Channel::MemberMap::const_iterator i = ulist.begin(); i != ulist.end(); ++i)
                        {
                                /*
                                 * Unlike Asuka, I define a clone as coming from the same host. --w00t
                                 */
-                               user->SendText("%s member %-3lu %s%s (%s@%s) %s ",
-                                       checkstr.c_str(), ServerInstance->Users->GlobalCloneCount(i->first),
+                               const UserManager::CloneCounts& clonecount = ServerInstance->Users->GetCloneCounts(i->first);
+                               user->SendText("%s member %-3u %s%s (%s@%s) %s ",
+                                       checkstr.c_str(), clonecount.global,
                                        i->second->GetAllPrefixChars(), i->first->nick.c_str(),
                                        i->first->ident.c_str(), i->first->dhost.c_str(), i->first->fullname.c_str());
                        }