summaryrefslogtreecommitdiff
path: root/src/channels.cpp
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-07-11 21:15:02 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-07-11 21:15:02 +0000
commit0b070b52bc8e8ceb52388e45cea90f4add119c4f (patch)
treec8934030ba064a432d4807fbe93b002ea0210d25 /src/channels.cpp
parentf8d9c513174926eae5b0545c56c310c90f295132 (diff)
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
Diffstat (limited to 'src/channels.cpp')
-rw-r--r--src/channels.cpp12
1 files changed, 3 insertions, 9 deletions
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);