diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-02-21 21:07:17 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-02-21 21:07:17 +0000 |
commit | 4648c98fa1b221d8c9dff5dcae030d33ac12982f (patch) | |
tree | 77acc0fcf7d40767367e4c56128d95207baa2765 /src/channels.cpp | |
parent | 326a73ff7bd43564cd850c9db2ca9ccde53a5292 (diff) |
Tests for channel ghosting?
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3276 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/channels.cpp')
-rw-r--r-- | src/channels.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index 9335fe251..8ca993f2b 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -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; } |