diff options
author | aquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-05-18 23:15:53 +0000 |
---|---|---|
committer | aquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-05-18 23:15:53 +0000 |
commit | 4b856bda135a08e800b96c970a10b0b6a34d433a (patch) | |
tree | 3a0b4e7e263cb84223ace2c9eef15ce46f9f5907 /src/commands/cmd_whowas.cpp | |
parent | 9d58c0986bfc4801a8d6388947f100317470bb5f (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/commands/cmd_whowas.cpp')
-rw-r--r-- | src/commands/cmd_whowas.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/commands/cmd_whowas.cpp b/src/commands/cmd_whowas.cpp index 8bc188eee..efd15e3d6 100644 --- a/src/commands/cmd_whowas.cpp +++ b/src/commands/cmd_whowas.cpp @@ -33,7 +33,7 @@ CmdResult CommandWhowas::Handle (const std::vector<std::string>& parameters, Use /* if whowas disabled in config */ if (ServerInstance->Config->WhoWasGroupSize == 0 || ServerInstance->Config->WhoWasMaxGroups == 0) { - user->WriteNumeric(421, "%s %s :This command has been disabled.",user->nick,command.c_str()); + user->WriteNumeric(421, "%s %s :This command has been disabled.",user->nick.c_str(),command.c_str()); return CMD_FAILURE; } @@ -41,8 +41,8 @@ CmdResult CommandWhowas::Handle (const std::vector<std::string>& parameters, Use if (i == whowas.end()) { - user->WriteNumeric(406, "%s %s :There was no such nickname",user->nick,parameters[0].c_str()); - user->WriteNumeric(369, "%s %s :End of WHOWAS",user->nick,parameters[0].c_str()); + user->WriteNumeric(406, "%s %s :There was no such nickname",user->nick.c_str(),parameters[0].c_str()); + user->WriteNumeric(369, "%s %s :End of WHOWAS",user->nick.c_str(),parameters[0].c_str()); return CMD_FAILURE; } else @@ -63,26 +63,26 @@ CmdResult CommandWhowas::Handle (const std::vector<std::string>& parameters, Use strlcpy(b,asctime(timeinfo),MAXBUF); b[24] = 0; - user->WriteNumeric(314, "%s %s %s %s * :%s",user->nick,parameters[0].c_str(),u->ident,u->dhost,u->gecos); + user->WriteNumeric(314, "%s %s %s %s * :%s",user->nick.c_str(),parameters[0].c_str(),u->ident,u->dhost,u->gecos); if (IS_OPER(user)) - user->WriteNumeric(379, "%s %s :was connecting from *@%s", user->nick, parameters[0].c_str(), u->host); + user->WriteNumeric(379, "%s %s :was connecting from *@%s", user->nick.c_str(), parameters[0].c_str(), u->host); if (*ServerInstance->Config->HideWhoisServer && !IS_OPER(user)) - user->WriteNumeric(312, "%s %s %s :%s",user->nick,parameters[0].c_str(), ServerInstance->Config->HideWhoisServer, b); + user->WriteNumeric(312, "%s %s %s :%s",user->nick.c_str(),parameters[0].c_str(), ServerInstance->Config->HideWhoisServer, b); else - user->WriteNumeric(312, "%s %s %s :%s",user->nick,parameters[0].c_str(), u->server, b); + user->WriteNumeric(312, "%s %s %s :%s",user->nick.c_str(),parameters[0].c_str(), u->server, b); } } else { - user->WriteNumeric(406, "%s %s :There was no such nickname",user->nick,parameters[0].c_str()); - user->WriteNumeric(369, "%s %s :End of WHOWAS",user->nick,parameters[0].c_str()); + user->WriteNumeric(406, "%s %s :There was no such nickname",user->nick.c_str(),parameters[0].c_str()); + user->WriteNumeric(369, "%s %s :End of WHOWAS",user->nick.c_str(),parameters[0].c_str()); return CMD_FAILURE; } } - user->WriteNumeric(369, "%s %s :End of WHOWAS",user->nick,parameters[0].c_str()); + user->WriteNumeric(369, "%s %s :End of WHOWAS",user->nick.c_str(),parameters[0].c_str()); return CMD_SUCCESS; } @@ -138,15 +138,15 @@ void CommandWhowas::AddToWhoWas(User* user) return; } - whowas_users::iterator iter = whowas.find(user->nick); + whowas_users::iterator iter = whowas.find(irc::string(user->nick.c_str())); if (iter == whowas.end()) { whowas_set* n = new whowas_set; WhoWasGroup *a = new WhoWasGroup(user); n->push_back(a); - whowas[user->nick] = n; - whowas_fifo.push_back(std::make_pair(ServerInstance->Time(),user->nick)); + whowas[user->nick.c_str()] = n; + whowas_fifo.push_back(std::make_pair(ServerInstance->Time(),user->nick.c_str())); if ((int)(whowas.size()) > ServerInstance->Config->WhoWasMaxGroups) { @@ -318,10 +318,10 @@ CommandWhowas::~CommandWhowas() WhoWasGroup::WhoWasGroup(User* user) : host(NULL), dhost(NULL), ident(NULL), server(NULL), gecos(NULL), signon(user->signon) { this->host = strdup(user->host); - this->dhost = strdup(user->dhost); - this->ident = strdup(user->ident); + this->dhost = strdup(user->dhost.c_str()); + this->ident = strdup(user->ident.c_str()); this->server = user->server; - this->gecos = strdup(user->fullname); + this->gecos = strdup(user->fullname.c_str()); } WhoWasGroup::~WhoWasGroup() |