]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Tests for channel ghosting?
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Tue, 21 Feb 2006 21:07:17 +0000 (21:07 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Tue, 21 Feb 2006 21:07:17 +0000 (21:07 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3276 e03df62e-2008-0410-955e-edbf42e46eb7

src/channels.cpp
src/users.cpp

index 9335fe25134281179bfbb5359e839a1d8f543b66..8ca993f2b6a461103dc004de145406109522f9d4 100644 (file)
@@ -440,6 +440,27 @@ chanrec* add_channel(userrec *user, const char* cn, const char* key, bool overri
 
        log(DEBUG,"add_channel: user channel max exceeded: %s %s",user->nick,cname);
        WriteServ(user->fd,"405 %s %s :You are on too many channels",user->nick, cname);
+
+       if (created == 2)
+       {
+               log(DEBUG,"BLAMMO, Whacking channel.");
+               /* Things went seriously pear shaped, so take this away. bwahaha. */
+               chan_hash::iterator n = chanlist.find(cname);
+               if (n != chanlist.end())
+               {
+                       Ptr->DelUser((char*)user);
+                       delete Ptr;
+                       chanlist.erase(n);
+                       for (unsigned int index =0; index < user->chans.size(); index++)
+                       {
+                               if (user->chans[index].channel == Ptr)
+                               {
+                                       user->chans[index].channel == NULL;
+                                       user->chans[index].uc_modes = 0;        
+                               }
+                       }
+               }
+       }
        return NULL;
 }
 
index c892862730c7a826435030f40225da81ab7a491c..a4be86c9e5f4d453ab1315aa066552fa58164df9 100644 (file)
@@ -397,6 +397,7 @@ void kill_link(userrec *user,const char* r)
         log(DEBUG,"closing fd %lu",(unsigned long)user->fd);
 
         if (user->registered == 7) {
+               purge_empty_chans(user);
                 FOREACH_MOD(I_OnUserQuit,OnUserQuit(user,reason));
                 WriteCommonExcept(user,"QUIT :%s",reason);
         }
@@ -425,7 +426,6 @@ void kill_link(userrec *user,const char* r)
         // this must come before the WriteOpers so that it doesnt try to fill their buffer with anything
         // if they were an oper with +s.
         if (user->registered == 7) {
-                purge_empty_chans(user);
                 // fix by brain: only show local quits because we only show local connects (it just makes SENSE)
                 if (user->fd > -1)
                         WriteOpers("*** Client exiting: %s!%s@%s [%s]",user->nick,user->ident,user->host,reason);