From 1624555b288f37a1896e12a3927c8348fde0e9c7 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 21 Apr 2006 10:48:56 +0000 Subject: [PATCH] Test tweak to clarify how channel joins work git-svn-id: http://svn.inspircd.org/repository/branches/1_0_stable@3902 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/channels.cpp | 11 +++++++++++ src/helperfuncs.cpp | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/channels.cpp b/src/channels.cpp index 3f2eca3f5..52d0dccbd 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -440,6 +440,17 @@ chanrec* add_channel(userrec *user, const char* cn, const char* key, bool overri } } } + else + { + 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; } diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 4905cfabd..e6e98492c 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -1225,7 +1225,7 @@ void purge_empty_chans(userrec* u) // firstly decrement the count on each channel for (std::vector::iterator f = u->chans.begin(); f != u->chans.end(); f++) { - if (((ucrec*)(*f))->channel) + if ((*f) && ((ucrec*)(*f))->channel) { if (((ucrec*)(*f))->channel->DelUser(u) == 0) {