]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_channelban.cpp
Change type of log messages to MODNAME in several modules
[user/henk/code/inspircd.git] / src / modules / m_channelban.cpp
index 3260c0fa48a0e07f8256f089a07ed98d463a8a79..ffb43eef1a514cedf57ce38dbf6eac25ad5c151f 100644 (file)
@@ -32,25 +32,19 @@ class ModuleBadChannelExtban : public Module
        {
                if ((mask.length() > 2) && (mask[0] == 'j') && (mask[1] == ':'))
                {
-                       std::string rm = mask.substr(2);
+                       std::string rm(mask, 2);
                        char status = 0;
-                       ModeHandler* mh = ServerInstance->Modes->FindPrefix(rm[0]);
+                       const PrefixMode* const mh = ServerInstance->Modes->FindPrefix(rm[0]);
                        if (mh)
                        {
-                               rm = mask.substr(3);
+                               rm.assign(mask, 3, std::string::npos);
                                status = mh->GetModeChar();
                        }
-                       for (UCListIter i = user->chans.begin(); i != user->chans.end(); i++)
+                       for (User::ChanList::iterator i = user->chans.begin(); i != user->chans.end(); i++)
                        {
-                               if (InspIRCd::Match((**i).name, rm))
+                               if (InspIRCd::Match((*i)->chan->name, rm))
                                {
-                                       if (status)
-                                       {
-                                               Membership* memb = (**i).GetUser(user);
-                                               if (memb && memb->hasMode(status))
-                                                       return MOD_RES_DENY;
-                                       }
-                                       else
+                                       if ((!status) || ((*i)->HasMode(mh)))
                                                return MOD_RES_DENY;
                                }
                        }