Changeset 780 for branches/ithildin-1.1


Ignore:
Timestamp:
10/02/06 01:30:16 (6 years ago)
Author:
wd
Message:

CHange the way WHOIS behaves to make it uniform no matter where the client
is, move the missing info from WHOIS to XINFO CLIENT.

Location:
branches/ithildin-1.1/modules/ircd/commands
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/ithildin-1.1/modules/ircd/commands/whois.c

    r737 r780  
    8080    /* show them the real host if they can see it and this is either a local 
    8181     * real client (conn != NULL) or orighost points somewhere different */ 
    82     if (CAN_SEE_REAL_HOST(cli, target)) { 
    83         if (target->conn != NULL) { 
    84             /* in this case show them the values we got from identd/dns */ 
    85             if (*target->conn->user == '\0' || *target->conn->user == '~') 
    86             sendto_one(cli, RPL_FMT(cli, RPL_WHOISACTUALLY), target->nick, 
    87                         target->user, target->conn->host, target->ip); 
    88             else 
    89                 sendto_one(cli, RPL_FMT(cli, RPL_WHOISACTUALLY), target->nick, 
    90                         target->conn->user, target->conn->host, target->ip); 
    91         } else if (target->orighost != target->host) 
    92             sendto_one(cli, RPL_FMT(cli, RPL_WHOISACTUALLY), target->nick, 
    93                     target->user, target->orighost, target->ip); 
    94     } 
     82    if (CAN_SEE_REAL_HOST(cli, target) && target->orighost != target->host) 
     83        sendto_one(cli, RPL_FMT(cli, RPL_WHOISACTUALLY), target->nick, 
     84                target->user, target->orighost, target->ip); 
    9585    if (!CLIENT_MASTER(target) || MYCLIENT(target)) { 
    9686        /* don't show channels that master clients are in unless this is a 
  • branches/ithildin-1.1/modules/ircd/commands/xinfo.c

    r751 r780  
    182182    client_t *cp; 
    183183    char rpl[XINFO_LEN]; 
     184    char *user; 
     185    char ip[IPADDR_MAXLEN + 1]; 
    184186 
    185187    if (argc < 2) { 
     
    197199    } 
    198200                 
    199     snprintf(rpl, XINFO_LEN, "%s!%s@%s[%s]", cp->nick, cp->user, cp->host, 
    200             cp->ip); 
     201    if (cp->conn != NULL) { 
     202        /* give them the connection info if we can... */ 
     203        if (*cp->conn->user == '\0' || *cp->conn->user == '~') 
     204            user = cp->user; /* this information is not valuable here */ 
     205        else 
     206            user = cp->conn->user; 
     207        if (cp->conn->sock != NULL) /* should never be NULL but.. */ 
     208            get_socket_address(isock_raddr(cp->conn->sock), ip, 
     209                    IPADDR_MAXLEN + 1, NULL); 
     210        else 
     211            strcpy(ip, cp->ip); 
     212        snprintf(rpl, XINFO_LEN, "%s!%s@%s[%s]", cp->nick, user, 
     213                cp->conn->host, ip); 
     214    } else 
     215        snprintf(rpl, XINFO_LEN, "%s!%s@%s[%s]", cp->nick, cp->user, 
     216                cp->host, cp->ip); 
    201217    sendto_one(cli, RPL_FMT(cli, RPL_XINFO), "ADDRESS", rpl); 
    202218    snprintf(rpl, XINFO_LEN, "TS %d SIGNON %d IDLE %d", cp->ts, 
Note: See TracChangeset for help on using the changeset viewer.