From 4e599dd4fbfe5abc0d60a05008344e35e6bc870d Mon Sep 17 00:00:00 2001 From: w00t Date: Fri, 11 Jul 2008 14:44:17 +0000 Subject: Fix m_nopartmsg to work via API modification, involves a string copy that won't last too long. Compiles cleanly. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9953 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/channels.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/channels.cpp') diff --git a/src/channels.cpp b/src/channels.cpp index 219979dc9..fbec272b3 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -482,10 +482,18 @@ bool Channel::IsExtBanned(User *user, char type) /* Channel::PartUser * remove a channel from a users record, and return the number of users left. * Therefore, if this function returns 0 the caller should delete the Channel. + * + * XXX: bleh, string copy of reason, fixme! -- w00t */ long Channel::PartUser(User *user, const char* reason) { bool silent = false; + std::string freason; + + if (reason) + freason = reason; + else + freason = ""; if (!user) return this->GetUserCounter(); @@ -493,7 +501,7 @@ long Channel::PartUser(User *user, const char* reason) UCListIter i = user->chans.find(this); if (i != user->chans.end()) { - FOREACH_MOD(I_OnUserPart,OnUserPart(user, this, reason ? reason : "", silent)); + FOREACH_MOD(I_OnUserPart,OnUserPart(user, this, freason, silent)); if (!silent) this->WriteChannel(user, "PART %s%s%s", this->name.c_str(), reason ? " :" : "", reason ? reason : ""); -- cgit v1.3.1-10-gc9f91