Improved server_get_network(): if we don't have the current network in the

network list use the server name in received in event 005.
(This fixes the problem that the network (%n) in the log file names would be
"NETWORK" instead of the real network name (this happened if the network was
not in the network list).)
This commit is contained in:
Diogo Sousa 2013-05-25 22:31:45 +01:00
parent 11478719cd
commit d934e60c2b
1 changed files with 5 additions and 0 deletions

View File

@ -1903,9 +1903,14 @@ server_set_defaults (server *serv)
char * char *
server_get_network (server *serv, gboolean fallback) server_get_network (server *serv, gboolean fallback)
{ {
/* check the network list */
if (serv->network) if (serv->network)
return ((ircnet *)serv->network)->name; return ((ircnet *)serv->network)->name;
/* check the network name given in 005 NETWORK=... */
if (serv->server_session && *serv->server_session->channel)
return serv->server_session->channel;
if (fallback) if (fallback)
return serv->servername; return serv->servername;