summaryrefslogtreecommitdiff
path: root/src/commands/cmd_who.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-19 21:16:42 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-19 21:16:42 +0000
commit31f1e7ad092f8bf16ee653cc105eea4a769650ca (patch)
treedced0411d5fbe803fe92ea54cb03d36c0a817563 /src/commands/cmd_who.cpp
parent869bd02318d94a38369a125726b8edeb54ba0706 (diff)
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
Diffstat (limited to 'src/commands/cmd_who.cpp')
-rw-r--r--src/commands/cmd_who.cpp8
1 files changed, 5 insertions, 3 deletions
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) + " " +