From 3fe17c6a0d9d4f6f8d7a45bf86d6c1c446dc6124 Mon Sep 17 00:00:00 2001 From: om Date: Fri, 3 Feb 2006 17:23:58 +0000 Subject: Stop uncloaked hosts showing to non-opers git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3049 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cmd_userhost.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/cmd_userhost.cpp b/src/cmd_userhost.cpp index aa190b17b..afe1a4358 100644 --- a/src/cmd_userhost.cpp +++ b/src/cmd_userhost.cpp @@ -66,21 +66,24 @@ void cmd_userhost::Handle (char **parameters, int pcnt, userrec *user) { char Return[MAXBUF],junk[MAXBUF]; snprintf(Return,MAXBUF,"302 %s :",user->nick); + for (int i = 0; i < pcnt; i++) { userrec *u = Find(parameters[i]); - if (u) + if(u) { - if (strchr(u->modes,'o')) - { - snprintf(junk,MAXBUF,"%s*=+%s@%s ",u->nick,u->ident,u->host); - strlcat(Return,junk,MAXBUF); - } + if(strchr(u->modes,'o')) + if(strchr(user->modes, 'o')) + snprintf(junk,MAXBUF,"%s*=+%s@%s ",u->nick,u->ident,u->host); + else + snprintf(junk,MAXBUF,"%s*=+%s@%s ",u->nick,u->ident,u->dhost); else - { - snprintf(junk,MAXBUF,"%s=+%s@%s ",u->nick,u->ident,u->host); - strlcat(Return,junk,MAXBUF); - } + if(strchr(user->modes, 'o')) + snprintf(junk,MAXBUF,"%s=+%s@%s ",u->nick,u->ident,u->host); + else + snprintf(junk,MAXBUF,"%s=+%s@%s ",u->nick,u->ident,u->dhost); + + strlcat(Return,junk,MAXBUF); } } WriteServ(user->fd,Return); -- cgit v1.2.3