From bea97870f21dd71442a6b7bff1e38f45e13c80ad Mon Sep 17 00:00:00 2001 From: Darren Date: Sat, 9 Feb 2019 14:56:25 +0000 Subject: [PATCH] Track the type of ircd to networkinfo --- src/commands/handlers/registration.js | 12 ++++++++++++ src/networkinfo.js | 3 +++ 2 files changed, 15 insertions(+) diff --git a/src/commands/handlers/registration.js b/src/commands/handlers/registration.js index b665b8ea..6789d777 100644 --- a/src/commands/handlers/registration.js +++ b/src/commands/handlers/registration.js @@ -23,6 +23,18 @@ var handlers = { }, + RPL_YOURHOST: function(command) { + // Your host is ircd.network.org, running version InspIRCd-2.0 + let param = command.params[1] || ''; + let m = param.match(/running version (.*)$/); + if (!m) { + this.network.ircd = ''; + } else { + this.network.ircd = m[1]; + } + }, + + RPL_ISUPPORT: function(command) { var options = command.params; var i; diff --git a/src/networkinfo.js b/src/networkinfo.js index e7a4cd3d..9c9832e4 100644 --- a/src/networkinfo.js +++ b/src/networkinfo.js @@ -9,6 +9,9 @@ function NetworkInfo() { // Name of the connected server this.server = ''; + // The reported IRCd type + this.ircd = ''; + // Network provided options this.options = { PREFIX: [