From 6f1b8f50dd8a9f73c9e02e64253e7e45642a88d0 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 8 Aug 2006 12:52:24 +0000 Subject: Change to chanrec::PartUser. As with KickUser and ServerKickUser, returns the number of users left, if it returns 0, delete the chanrec git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4786 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_park.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/modules/m_park.cpp') diff --git a/src/modules/m_park.cpp b/src/modules/m_park.cpp index 9fbae3529..31da8f033 100644 --- a/src/modules/m_park.cpp +++ b/src/modules/m_park.cpp @@ -163,9 +163,11 @@ class cmd_unpark : public command_t // first part the user from all chans theyre on, so things dont get messy for (std::vector::iterator i = user->chans.begin(); i != user->chans.end(); i++) { - if (((ucrec*)(*i))->channel != NULL) + chanrec* chan = (*i)->channel; + if (chan != NULL) { - Srv->PartUserFromChannel(user,((ucrec*)(*i))->channel->name,"Unparking"); + if (!chan->PartUser(user, "Unparking")) + delete chan; } } // remove all their old modes -- cgit v1.2.3