From d934e60c2bb564d8be41be23eea39faafa4dc384 Mon Sep 17 00:00:00 2001 From: Diogo Sousa Date: Sat, 25 May 2013 22:31:45 +0100 Subject: 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).) --- src/common/server.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/common') diff --git a/src/common/server.c b/src/common/server.c index 3f7027e2..99e7563e 100644 --- a/src/common/server.c +++ b/src/common/server.c @@ -1903,9 +1903,14 @@ server_set_defaults (server *serv) char * server_get_network (server *serv, gboolean fallback) { + /* check the network list */ if (serv->network) 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) return serv->servername; -- cgit 1.4.1