From d373e9791a9c82a00f2a32bcfdb5b951c0dc9043 Mon Sep 17 00:00:00 2001 From: mappu Date: Tue, 29 Nov 2016 19:23:00 +1300 Subject: [PATCH] fix parsing connection modes in MyINFO --- UserInfo.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UserInfo.go b/UserInfo.go index 0c4f4aa..6447cd6 100644 --- a/UserInfo.go +++ b/UserInfo.go @@ -71,7 +71,7 @@ var rx_myinfo *regexp.Regexp var rx_myinfo_notag *regexp.Regexp func init() { - // $ALL $ $$$$ + // Format: $ALL $ $$$$ HEAD := `(?ms)^\$ALL ([^ ]+) ` FOOT := `\$.\$([^$]+)\$([^$]*)\$([0-9]*)\$$` @@ -106,7 +106,7 @@ func (this *UserInfo) fromMyINFO(protomsg string) error { this.Description = NMDCUnescape(matches[2]) this.ClientTag = NMDCUnescape(matches[3]) this.ClientVersion = matches[4] - this.ConnectionMode = ConnectionMode(matches[4][0]) + this.ConnectionMode = ConnectionMode(matches[5][0]) maybeParse(matches[6], &this.HubsUnregistered, 0) maybeParse(matches[7], &this.HubsRegistered, 0) maybeParse(matches[8], &this.HubsOperator, 0)