]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_banredirect.cpp
Remove unnecessary header traffic
[user/henk/code/inspircd.git] / src / modules / m_banredirect.cpp
index 1764e6f56689b7f4dfb74af3804c6a2a9aa24aa1..9fa36b5169b045572bb69d8e98505180e05fc0aa 100644 (file)
  */
 
 #include "inspircd.h"
-#include "mode.h"
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
 #include "u_listmode.h"
 
 /* $ModDesc: Allows an extended ban (+b) syntax redirecting banned users to another channel */
@@ -66,7 +62,7 @@ class BanRedirect : public ModeWatcher
                        std::string::iterator start_pos = param.begin();
                        long maxbans = channel->GetMaxBans();
                
-                       if(channel->bans.size() > static_cast<unsigned>(maxbans))
+                       if(adding && (channel->bans.size() > static_cast<unsigned>(maxbans)))
                        {
                                source->WriteServ("478 %s %s :Channel ban list for %s is full (maximum entries for this channel is %d)", source->nick, channel->name, channel->name, maxbans);
                                return false;
@@ -309,7 +305,8 @@ class ModuleBanRedirect : public Module
                                                }
                                                else
                                                {
-                                                       user->WriteServ("470 %s :You are banned from %s. You are being automatically redirected to %s", user->nick, chan->name, redir->targetchan.c_str());
+                                                       user->WriteServ("474 %s %s :Cannot join channel (You are banned)", user->nick, chan->name);
+                                                       user->WriteServ("470 %s :You are being automatically redirected to %s", user->nick, redir->targetchan.c_str());
                                                        nofollow = true;
                                                        chanrec::JoinUser(ServerInstance, user, redir->targetchan.c_str(), false, "", ServerInstance->Time(true));
                                                        nofollow = false;