]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_banredirect.cpp
Rename the spanningtree module header to server.
[user/henk/code/inspircd.git] / src / modules / m_banredirect.cpp
index c44a10f05c35896f0543b63d8635b6fbb5768eaf..4a4188757c23f31c5f59c59c065214ba88de984d 100644 (file)
@@ -54,7 +54,7 @@ class BanRedirect : public ModeWatcher
        {
        }
 
-       bool BeforeMode(User* source, User* dest, Channel* channel, std::string &param, bool adding)
+       bool BeforeMode(User* source, User* dest, Channel* channel, std::string& param, bool adding) CXX11_OVERRIDE
        {
                /* nick!ident@host -> nick!ident@host
                 * nick!ident@host#chan -> nick!ident@host#chan
@@ -166,7 +166,7 @@ class BanRedirect : public ModeWatcher
                                                return false;
                                        }
 
-                                       if (assign(channel->name) == mask[CHAN])
+                                       if (irc::equals(channel->name, mask[CHAN]))
                                        {
                                                source->WriteNumeric(690, channel->name, "You cannot set a ban redirection to the channel the ban is on");
                                                return false;
@@ -199,8 +199,7 @@ class BanRedirect : public ModeWatcher
 
                                                for(BanRedirectList::iterator redir = redirects->begin(); redir != redirects->end(); redir++)
                                                {
-                                                       /* Ugly as fuck */
-                                                       if((irc::string(redir->targetchan.c_str()) == irc::string(mask[CHAN].c_str())) && (irc::string(redir->banmask.c_str()) == irc::string(param.c_str())))
+                                                       if ((irc::equals(redir->targetchan, mask[CHAN])) && (irc::equals(redir->banmask, param)))
                                                        {
                                                                redirects->erase(redir);
 
@@ -240,9 +239,9 @@ class ModuleBanRedirect : public Module
        {
        }
 
-       void OnCleanup(int target_type, void* item) CXX11_OVERRIDE
+       void OnCleanup(ExtensionItem::ExtensibleType type, Extensible* item) CXX11_OVERRIDE
        {
-               if(target_type == TYPE_CHANNEL)
+               if (type == ExtensionItem::EXT_CHANNEL)
                {
                        Channel* chan = static_cast<Channel*>(item);
                        BanRedirectList* redirects = re.extItem.get(chan);
@@ -309,7 +308,7 @@ class ModuleBanRedirect : public Module
                                                if (destchan)
                                                        destlimit = destchan->GetModeParameter(limitmode);
 
-                                               if(destchan && destchan->IsModeSet(redirectmode) && !destlimit.empty() && (destchan->GetUserCounter() >= atoi(destlimit.c_str())))
+                                               if(destchan && destchan->IsModeSet(redirectmode) && !destlimit.empty() && (destchan->GetUserCounter() >= ConvToNum<size_t>(destlimit)))
                                                {
                                                        user->WriteNumeric(ERR_BANNEDFROMCHAN, chan->name, "Cannot join channel (You are banned)");
                                                        return MOD_RES_DENY;