From 0df6237005c192fbda022ad9dc2918209eb130ef Mon Sep 17 00:00:00 2001 From: "." <.@.> Date: Tue, 10 May 2016 18:56:32 +1200 Subject: [PATCH] strip leading v from mirc version --HG-- branch : nmdc-ircfrontend --- server.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server.go b/server.go index 597ba69..b1393d9 100644 --- a/server.go +++ b/server.go @@ -514,6 +514,7 @@ func (s *Server) SetClientSoftwareVersion(ver string) { // "AndChat 1.4.3.2 http://www.andchat.net" // "liteIRC for Android 1.1.8" // ":Relay:1.0:Android" + // "mIRC v7.45" // A bit long and unwieldy. // Heuristic: keep the first word, and the the first word containing digits @@ -531,6 +532,11 @@ func (s *Server) SetClientSoftwareVersion(ver string) { } } + // Strip leading v from mIRC + if len(version) >= 2 && (version[0] == 'v' || version[0] == 'V') && strings.ContainsAny(string(version[1]), "0123456789") { + version = version[1:] + } + s.verbosef("Replacing client tag with '%s' version '%s'", tag, version) s.upstreamLauncher.Self.ClientTag = tag