summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorTingPing <tngpng@gmail.com>2013-05-25 16:31:51 -0700
committerTingPing <tngpng@gmail.com>2013-05-25 16:31:51 -0700
commitc9c8993b9d5b4189c9370bfa8af76da85387ff5c (patch)
tree5531ecee67f44d2623fca85131a9bb3645d9ccda
parent11478719cd77ff303844a494c36d4361630d7f45 (diff)
parentd934e60c2bb564d8be41be23eea39faafa4dc384 (diff)
Merge pull request #625 from orium/network-name-improve
Improved server_get_network()
-rw-r--r--src/common/server.c5
1 files changed, 5 insertions, 0 deletions
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;