diff options
author | om <om@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-30 21:07:24 +0000 |
---|---|---|
committer | om <om@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-30 21:07:24 +0000 |
commit | c73bb5d2ca948e418fc531840b382e378c9d47f6 (patch) | |
tree | d724910e7cae2cc0573867ecb2dcdf05ebb5ba80 /src/cmd_whowas.cpp | |
parent | a46930efdc701520a187263e0f08195dcb344ef2 (diff) |
Make /whois code a little prettier, make /whowas show real host as well as displayed host and show real server/fake server correctly (real to opers). Remove some unecessary casts
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3788 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/cmd_whowas.cpp')
-rw-r--r-- | src/cmd_whowas.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/cmd_whowas.cpp b/src/cmd_whowas.cpp index d70b1eafa..143877219 100644 --- a/src/cmd_whowas.cpp +++ b/src/cmd_whowas.cpp @@ -73,22 +73,31 @@ void cmd_whowas::Handle (char **parameters, int pcnt, userrec* user) } else { - whowas_set* grp = (whowas_set*)i->second; + whowas_set* grp = i->second; if (grp->size()) { for (whowas_set::iterator ux = grp->begin(); ux != grp->end(); ux++) { - WhoWasGroup* u = (WhoWasGroup*)*ux; + WhoWasGroup* u = *ux; time_t rawtime = u->signon; tm *timeinfo; char b[MAXBUF]; timeinfo = localtime(&rawtime); + + /* XXX - 'b' could be only 25 chars long and then strlcpy() would terminate it for us too? */ strlcpy(b,asctime(timeinfo),MAXBUF); b[24] = 0; WriteServ(user->fd,"314 %s %s %s %s * :%s",user->nick,parameters[0],u->ident,u->dhost,u->gecos); - WriteServ(user->fd,"312 %s %s %s :%s",user->nick,parameters[0], *Config->HideWhoisServer ? Config->HideWhoisServer : u->server,b); + + if(*user->oper) + WriteServ(user->fd,"379 %s %s :was connecting from *@%s", user->nick, parameters[0], u->host); + + if(*Config->HideWhoisServer && !(*user->oper)) + WriteServ(user->fd,"312 %s %s %s :%s",user->nick,parameters[0], Config->HideWhoisServer, b); + else + WriteServ(user->fd,"312 %s %s %s :%s",user->nick,parameters[0], u->server, b); } } else @@ -96,6 +105,6 @@ void cmd_whowas::Handle (char **parameters, int pcnt, userrec* user) WriteServ(user->fd,"406 %s %s :There was no such nickname",user->nick,parameters[0]); } } + WriteServ(user->fd,"369 %s %s :End of WHOWAS",user->nick,parameters[0]); } - |