]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/channels.cpp
Removed some debug notices that were mistakenly in the DEFAULT loglevel
[user/henk/code/inspircd.git] / src / channels.cpp
index 61f7d92caefe50b113ad5c0674cae2e349b43e1c..4c6634a161d03aea45a382e9e6f9ea2756e6c234 100644 (file)
@@ -171,9 +171,12 @@ void chanrec::DelUser(char* castuser)
        {
                log(DEBUG,"Removed casted user from channel's internal list");
                internal_userlist.erase(a);
+               /* And tidy any others... */
+               DelOppedUser(castuser);
+               DelHalfoppedUser(castuser);
+               DelVoicedUser(castuser);
                return;
        }
-       log(DEBUG,"BUG BUG BUG! Attempt to remove an uncasted user from the internal list of %s!",name);
 }
 
 void chanrec::AddOppedUser(char* castuser)
@@ -191,7 +194,6 @@ void chanrec::DelOppedUser(char* castuser)
                 internal_op_userlist.erase(a);
                 return;
         }
-        log(DEBUG,"BUG BUG BUG! Attempt to remove an uncasted user from the internal list of %s!",name);
 }
 
 void chanrec::AddHalfoppedUser(char* castuser)
@@ -209,7 +211,6 @@ void chanrec::DelHalfoppedUser(char* castuser)
                 internal_halfop_userlist.erase(a);
                 return; 
         }       
-        log(DEBUG,"BUG BUG BUG! Attempt to remove an uncasted user from the internal list of %s!",name);
 }
 
 void chanrec::AddVoicedUser(char* castuser)
@@ -227,7 +228,6 @@ void chanrec::DelVoicedUser(char* castuser)
                 internal_voice_userlist.erase(a);
                 return; 
         }       
-        log(DEBUG,"BUG BUG BUG! Attempt to remove an uncasted user from the internal list of %s!",name);
 }
 
 std::map<char*,char*> *chanrec::GetUsers()
@@ -589,33 +589,38 @@ void kick_channel(userrec *src,userrec *user, chanrec *Ptr, char* reason)
                        return;
                }
                int MOD_RESULT = 0;
-               FOREACH_RESULT(I_OnAccessCheck,OnAccessCheck(src,user,Ptr,AC_KICK));
-               if ((MOD_RESULT == ACR_DENY) && (!is_uline(src->server)))
-                       return;
-       
-               if ((MOD_RESULT == ACR_DEFAULT) || (!is_uline(src->server)))
-               {
-                       if ((cstatus(src,Ptr) < STATUS_HOP) || (cstatus(src,Ptr) < cstatus(user,Ptr)))
-                       {
-                               if (cstatus(src,Ptr) == STATUS_HOP)
-                               {
-                                       WriteServ(src->fd,"482 %s %s :You must be a channel operator",src->nick, Ptr->name);
-                               }
-                               else
-                               {
-                                       WriteServ(src->fd,"482 %s %s :You must be at least a half-operator to change modes on this channel",src->nick, Ptr->name);
-                               }
+
+               if (!is_uline(src->server))
+               {
+                       MOD_RESULT = 0;
+                       FOREACH_RESULT(I_OnUserPreKick,OnUserPreKick(src,user,Ptr,reason));
+                       if (MOD_RESULT == 1)
+                               return;
+               }
+               /* Set to -1 by OnUserPreKick if explicit allow was set */
+               if (MOD_RESULT != -1)
+               {
+                       FOREACH_RESULT(I_OnAccessCheck,OnAccessCheck(src,user,Ptr,AC_KICK));
+                       if ((MOD_RESULT == ACR_DENY) && (!is_uline(src->server)))
+                               return;
        
-                               return;
-                       }
-               }
-               if (!is_uline(src->server))
-               {
-                       MOD_RESULT = 0;
-                       FOREACH_RESULT(I_OnUserPreKick,OnUserPreKick(src,user,Ptr,reason));
-                       if (MOD_RESULT)
-                               return;
-               }
+                       if ((MOD_RESULT == ACR_DEFAULT) || (!is_uline(src->server)))
+                       {
+                                       if ((cstatus(src,Ptr) < STATUS_HOP) || (cstatus(src,Ptr) < cstatus(user,Ptr)))
+                               {
+                                       if (cstatus(src,Ptr) == STATUS_HOP)
+                                       {
+                                               WriteServ(src->fd,"482 %s %s :You must be a channel operator",src->nick, Ptr->name);
+                                       }
+                                       else
+                                       {
+                                               WriteServ(src->fd,"482 %s %s :You must be at least a half-operator to change modes on this channel",src->nick, Ptr->name);
+                                       }
+               
+                                       return;
+                               }
+                       }
+               }
        }
 
         FOREACH_MOD(I_OnUserKick,OnUserKick(src,user,Ptr,reason));