summaryrefslogtreecommitdiff
path: root/src/cull_list.cpp
diff options
context:
space:
mode:
authoraquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-18 23:15:53 +0000
committeraquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-18 23:15:53 +0000
commit4b856bda135a08e800b96c970a10b0b6a34d433a (patch)
tree3a0b4e7e263cb84223ace2c9eef15ce46f9f5907 /src/cull_list.cpp
parent9d58c0986bfc4801a8d6388947f100317470bb5f (diff)
Make User:: nick/ident/dhost/fullname and some other things std::string instead of char*/char[] (MODULES DO NOT COMPILE)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9748 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/cull_list.cpp')
-rw-r--r--src/cull_list.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/cull_list.cpp b/src/cull_list.cpp
index db9d4978e..26f3b4e43 100644
--- a/src/cull_list.cpp
+++ b/src/cull_list.cpp
@@ -25,7 +25,7 @@ void CullList::AddItem(User* user)
{
if (user->quitting)
{
- ServerInstance->Logs->Log("CULLLIST",DEBUG, "*** Warning *** - You tried to quit a user (%s) twice. Did your module call QuitUser twice?", user->nick);
+ ServerInstance->Logs->Log("CULLLIST",DEBUG, "*** Warning *** - You tried to quit a user (%s) twice. Did your module call QuitUser twice?", user->nick.c_str());
return;
}
@@ -50,14 +50,12 @@ int CullList::Apply()
User *u = (*a);
user_hash::iterator iter = ServerInstance->Users->clientlist->find(u->nick);
- const char* preset_reason = u->GetOperQuit();
- std::string reason = u->quitmsg;
- std::string oper_reason = *preset_reason ? preset_reason : u->operquitmsg;
+ const std::string& preset_reason = u->GetOperQuit();
+ std::string reason;
+ std::string oper_reason;
- if (reason.length() > MAXQUIT - 1)
- reason.resize(MAXQUIT - 1);
- if (oper_reason.length() > MAXQUIT - 1)
- oper_reason.resize(MAXQUIT - 1);
+ reason.assign(u->quitmsg, 0, MAXQUIT - 1);
+ oper_reason.assign(preset_reason.empty() ? preset_reason : u->operquitmsg, 0, MAXQUIT - 1);
if (u->registered != REG_ALL)
if (ServerInstance->Users->unregistered_count)
@@ -106,14 +104,14 @@ int CullList::Apply()
{
if (!u->quietquit)
{
- ServerInstance->SNO->WriteToSnoMask('q',"Client exiting: %s!%s@%s [%s]",u->nick,u->ident,u->host,oper_reason.c_str());
+ ServerInstance->SNO->WriteToSnoMask('q',"Client exiting: %s!%s@%s [%s]",u->nick.c_str(),u->ident.c_str(),u->host,oper_reason.c_str());
}
}
else
{
if ((!ServerInstance->SilentULine(u->server)) && (!u->quietquit))
{
- ServerInstance->SNO->WriteToSnoMask('Q',"Client exiting on server %s: %s!%s@%s [%s]",u->server,u->nick,u->ident,u->host,oper_reason.c_str());
+ ServerInstance->SNO->WriteToSnoMask('Q',"Client exiting on server %s: %s!%s@%s [%s]",u->server,u->nick.c_str(),u->ident.c_str(),u->host,oper_reason.c_str());
}
}
u->AddToWhoWas();