-
-const char *
-get_server_name(struct Client *target_p, int showip)
-{
- static char nbuf[HOSTLEN * 2 + USERLEN + 5];
-
- if(target_p == NULL)
- return NULL;
-
- if(!MyConnect(target_p) || !irccmp(target_p->name, target_p->host))
- return target_p->name;
-
-#ifdef HIDE_SERVERS_IPS
- if(EmptyString(target_p->name))
- {
- rb_snprintf(nbuf, sizeof(nbuf), "[%s@255.255.255.255]",
- target_p->username);
- return nbuf;
- }
- else
- return target_p->name;
-#endif
-
- switch (showip)
- {
- case SHOW_IP:
- rb_snprintf(nbuf, sizeof(nbuf), "%s[%s@%s]",
- target_p->name, target_p->username,
- target_p->sockhost);
- break;
-
- case MASK_IP:
- rb_snprintf(nbuf, sizeof(nbuf), "%s[%s@255.255.255.255]",
- target_p->name, target_p->username);
-
- default:
- rb_snprintf(nbuf, sizeof(nbuf), "%s[%s@%s]",
- target_p->name, target_p->username,
- target_p->host);
- }
-
- return nbuf;
-}