From 31f1e7ad092f8bf16ee653cc105eea4a769650ca Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 19 May 2008 21:16:42 +0000 Subject: Convert channel::name to std::string, this was a beastie! git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9770 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/commands/cmd_who.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/commands/cmd_who.cpp') diff --git a/src/commands/cmd_who.cpp b/src/commands/cmd_who.cpp index 7f4365204..a9f27de83 100644 --- a/src/commands/cmd_who.cpp +++ b/src/commands/cmd_who.cpp @@ -15,7 +15,9 @@ #include "wildcard.h" #include "commands/cmd_who.h" -static const char *get_first_visible_channel(User *u) +static const std::string star = "*"; + +static const std::string& get_first_visible_channel(User *u) { UCListIter i = u->chans.begin(); if (i != u->chans.end()) @@ -24,7 +26,7 @@ static const char *get_first_visible_channel(User *u) return i->first->name; } - return "*"; + return star; } bool CommandWho::whomatch(User* user, const char* matchtext) @@ -138,7 +140,7 @@ void CommandWho::SendWhoLine(User* user, const std::string &initial, Channel* ch if (u->Visibility && !u->Visibility->VisibleTo(user)) return; - std::string lcn = get_first_visible_channel(u); + const std::string& lcn = get_first_visible_channel(u); Channel* chlast = ServerInstance->FindChan(lcn); std::string wholine = initial + (ch ? ch->name : lcn) + " " + u->ident + " " + (opt_showrealhost ? u->host : u->dhost) + " " + -- cgit v1.2.3