summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-03 17:23:58 +0000
committerom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-03 17:23:58 +0000
commit3fe17c6a0d9d4f6f8d7a45bf86d6c1c446dc6124 (patch)
tree90dc439f084b5251f55bf5cc37e9a960e79f8681
parent785bfb8a0b9bddeca9b176cb29203f1995bcc2c4 (diff)
Stop uncloaked hosts showing to non-opers
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3049 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/cmd_userhost.cpp23
1 files 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);