identd: Fix respecting USE_GLOBAL network flag

This commit is contained in:
Patrick Griffis 2016-03-28 00:31:00 -04:00
parent 77ac0863f8
commit 795e97f428
1 changed files with 3 additions and 2 deletions

View File

@ -836,6 +836,7 @@ server_read_child (GIOChannel *source, GIOCondition condition, server *serv)
struct sockaddr addr; struct sockaddr addr;
int addr_len = sizeof (addr); int addr_len = sizeof (addr);
guint16 port; guint16 port;
ircnet *net = serv->network;
if (!getsockname (serv->sok, &addr, &addr_len)) if (!getsockname (serv->sok, &addr, &addr_len))
{ {
@ -845,8 +846,8 @@ server_read_child (GIOChannel *source, GIOCondition condition, server *serv)
port = ntohs(((struct sockaddr_in6 *)&addr)->sin6_port); port = ntohs(((struct sockaddr_in6 *)&addr)->sin6_port);
g_snprintf (outbuf, sizeof (outbuf), "IDENTD %"G_GUINT16_FORMAT" ", port); g_snprintf (outbuf, sizeof (outbuf), "IDENTD %"G_GUINT16_FORMAT" ", port);
if (serv->network && ((ircnet *)serv->network)->user) if (net && net->user && !(net->flags & FLAG_USE_GLOBAL))
g_strlcat (outbuf, ((ircnet *)serv->network)->user, sizeof (outbuf)); g_strlcat (outbuf, net->user, sizeof (outbuf));
else else
g_strlcat (outbuf, prefs.hex_irc_user_name, sizeof (outbuf)); g_strlcat (outbuf, prefs.hex_irc_user_name, sizeof (outbuf));