From 0b070b52bc8e8ceb52388e45cea90f4add119c4f Mon Sep 17 00:00:00 2001 From: w00t Date: Fri, 11 Jul 2008 21:15:02 +0000 Subject: Convert API to use std::string, fixes my slight bug from earlier and looks tidier git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9956 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/channels.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/channels.cpp') diff --git a/src/channels.cpp b/src/channels.cpp index fbec272b3..47dfd91b6 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -485,15 +485,9 @@ bool Channel::IsExtBanned(User *user, char type) * * XXX: bleh, string copy of reason, fixme! -- w00t */ -long Channel::PartUser(User *user, const char* reason) +long Channel::PartUser(User *user, std::string &reason) { bool silent = false; - std::string freason; - - if (reason) - freason = reason; - else - freason = ""; if (!user) return this->GetUserCounter(); @@ -501,10 +495,10 @@ 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, freason, silent)); + FOREACH_MOD(I_OnUserPart,OnUserPart(user, this, reason, silent)); if (!silent) - this->WriteChannel(user, "PART %s%s%s", this->name.c_str(), reason ? " :" : "", reason ? reason : ""); + this->WriteChannel(user, "PART %s%s%s", this->name.c_str(), reason.empty() ? "" : ":", reason.c_str()); user->chans.erase(i); this->RemoveAllPrefixes(user); -- cgit v1.2.3