func (p *NetworkInfo) ParseISupport(e *Event) {
	p.protect.Lock()
	defer p.protect.Unlock()
	for _, arg := range e.Args[1:] {
		if strings.Contains(arg, " ") {
			continue
		}
		regexResult := capsRegexp.FindStringSubmatch(arg)
		name, value := regexResult[1], regexResult[2]
		if strings.HasPrefix(name, INFO_RFC) {
			p.rfc = name
			continue
		}
		switch name {
		case INFO_IRCD:
			p.ircd = value
		case INFO_CASEMAPPING:
			p.casemapping = value
		case INFO_PREFIX:
			p.prefix = value
		case INFO_CHANTYPES:
			p.chantypes = value
		case INFO_CHANMODES:
			p.chanmodes = value
		case INFO_CHANLIMIT:
			if strings.Contains(value, ":") {
				value = strings.Split(value, ":")[1]
			}
			i, e := strconv.Atoi(value)
			if e == nil {
				p.chanlimit = i
			}
		case INFO_CHANNELLEN:
			i, e := strconv.Atoi(value)
			if e == nil {
				p.channellen = i
			}
		case INFO_NICKLEN:
			i, e := strconv.Atoi(value)
			if e == nil {
				p.nicklen = i
			}
		case INFO_TOPICLEN:
			i, e := strconv.Atoi(value)
			if e == nil {
				p.topiclen = i
			}
		case INFO_AWAYLEN:
			i, e := strconv.Atoi(value)
			if e == nil {
				p.awaylen = i
			}
		case INFO_KICKLEN:
			i, e := strconv.Atoi(value)
			if e == nil {
				p.kicklen = i
			}
		case INFO_MODES:
			i, e := strconv.Atoi(value)
			if e == nil {
				p.modes = i
			}
		default:
			if value == "" {
				value = "true"
			}
			p.extras[name] = value
		}
	}
}
ParseISupport adds all values in a 005 to the current networkinfo object.
package irc
import (
	"regexp"
	"strconv"
	"strings"
	"sync"
)
const (
	INFO_RFC         = "RFC"
	INFO_IRCD        = "IRCD"
	INFO_CASEMAPPING = "CASEMAPPING"
	INFO_PREFIX      = "PREFIX"
	INFO_CHANTYPES   = "CHANTYPES"
	INFO_CHANMODES   = "CHANMODES"
	INFO_CHANLIMIT   = "CHANLIMIT"
	INFO_CHANNELLEN  = "CHANNELLEN"
	INFO_NICKLEN     = "NICKLEN"
	INFO_TOPICLEN    = "TOPICLEN"
	INFO_AWAYLEN     = "AWAYLEN"
	INFO_KICKLEN     = "KICKLEN"
	INFO_MODES       = "MODES"
)
const (
	INFO_DEFAULT_SERVERNAME  = "unknown"
	INFO_DEFAULT_IRCDVERSION = "unknown"
	INFO_DEFAULT_USERMODES   = "acCiorRswx"
	INFO_DEFAULT_LCHANMODES  = "beiIklmnoOPrRstvz"
	INFO_DEFAULT_RFC         = "RFC2812"
	INFO_DEFAULT_IRCD        = "unknown"
	INFO_DEFAULT_CASEMAPPING = "ascii"
	INFO_DEFAULT_PREFIX      = "(ov)@+"
	INFO_DEFAULT_CHANTYPES   = "#&~"
	INFO_DEFAULT_CHANMODES   = "beI,k,l,imnOPRstz"
	INFO_DEFAULT_CHANLIMIT   = 20
	INFO_DEFAULT_CHANNELLEN  = 50
	INFO_DEFAULT_NICKLEN     = 9
	INFO_DEFAULT_TOPICLEN    = 490
	INFO_DEFAULT_AWAYLEN     = 127
	INFO_DEFAULT_KICKLEN     = 400
	INFO_DEFAULT_MODES       = 5
)
var (
	capsRegexp = regexp.MustCompile(`^(?i)([A-Z0-9]+)(?:=([^\s]+))?$`)
)
type NetworkInfo struct {
	serverName string
	ircdVersion string
	usermodes string
	lchanmodes string
	rfc string
	ircd string
	casemapping string
	prefix string
	chantypes string
	chanmodes string
	chanlimit int
	channellen int
	nicklen int
	topiclen int
	awaylen int
	kicklen int
	modes int
	extras map[string]string
	protect *sync.RWMutex
}
func NewNetworkInfo() *NetworkInfo {
	p := &NetworkInfo{
		serverName:  INFO_DEFAULT_SERVERNAME,
		ircdVersion: INFO_DEFAULT_IRCDVERSION,
		usermodes:   INFO_DEFAULT_USERMODES,
		lchanmodes:  INFO_DEFAULT_LCHANMODES,
		rfc:         INFO_DEFAULT_RFC,
		ircd:        INFO_DEFAULT_IRCD,
		casemapping: INFO_DEFAULT_CASEMAPPING,
		prefix:      INFO_DEFAULT_PREFIX,
		chantypes:   INFO_DEFAULT_CHANTYPES,
		chanmodes:   INFO_DEFAULT_CHANMODES,
		chanlimit:   INFO_DEFAULT_CHANLIMIT,
		channellen:  INFO_DEFAULT_CHANNELLEN,
		nicklen:     INFO_DEFAULT_NICKLEN,
		topiclen:    INFO_DEFAULT_TOPICLEN,
		awaylen:     INFO_DEFAULT_AWAYLEN,
		kicklen:     INFO_DEFAULT_KICKLEN,
		modes:       INFO_DEFAULT_MODES,
		extras:      make(map[string]string),
		protect: new(sync.RWMutex),
	}
	return p
}
func (p *NetworkInfo) Clone() *NetworkInfo {
	p.protect.RLock()
	defer p.protect.RUnlock()
	clone := *p
	clone.extras = make(map[string]string)
	for k, v := range p.extras {
		clone.extras[k] = v
	}
	clone.protect = new(sync.RWMutex)
	return &clone
}
func (p *NetworkInfo) ServerName() string {
	p.protect.RLock()
	defer p.protect.RUnlock()
	return p.serverName
}
func (p *NetworkInfo) IrcdVersion() string {
	p.protect.RLock()
	defer p.protect.RUnlock()
	return p.ircdVersion
}
func (p *NetworkInfo) Usermodes() string {
	p.protect.RLock()
	defer p.protect.RUnlock()
	return p.usermodes
}
func (p *NetworkInfo) LegacyChanmodes() string {
	p.protect.RLock()
	defer p.protect.RUnlock()
	return p.lchanmodes
}
func (p *NetworkInfo) RFC() string {
	p.protect.RLock()
	defer p.protect.RUnlock()
	return p.rfc
}
func (p *NetworkInfo) IRCD() string {
	p.protect.RLock()
	defer p.protect.RUnlock()
	return p.ircd
}
func (p *NetworkInfo) Casemapping() string {
	p.protect.RLock()
	defer p.protect.RUnlock()
	return p.casemapping
}
func (p *NetworkInfo) Prefix() string {
	p.protect.RLock()
	defer p.protect.RUnlock()
	return p.prefix
}
func (p *NetworkInfo) Chantypes() string {
	p.protect.RLock()
	defer p.protect.RUnlock()
	return p.chantypes
}
func (p *NetworkInfo) Chanmodes() string {
	p.protect.RLock()
	defer p.protect.RUnlock()
	return p.chanmodes
}
func (p *NetworkInfo) Chanlimit() int {
	p.protect.RLock()
	defer p.protect.RUnlock()
	return p.chanlimit
}
func (p *NetworkInfo) Channellen() int {
	p.protect.RLock()
	defer p.protect.RUnlock()
	return p.channellen
}
func (p *NetworkInfo) Nicklen() int {
	p.protect.RLock()
	defer p.protect.RUnlock()
	return p.nicklen
}
func (p *NetworkInfo) Topiclen() int {
	p.protect.RLock()
	defer p.protect.RUnlock()
	return p.topiclen
}
func (p *NetworkInfo) Awaylen() int {
	p.protect.RLock()
	defer p.protect.RUnlock()
	return p.awaylen
}
func (p *NetworkInfo) Kicklen() int {
	p.protect.RLock()
	defer p.protect.RUnlock()
	return p.kicklen
}
func (p *NetworkInfo) Modes() int {
	p.protect.RLock()
	defer p.protect.RUnlock()
	return p.modes
}
func (p *NetworkInfo) Extra(key string) string {
	p.protect.RLock()
	defer p.protect.RUnlock()
	return p.extras[key]
}
func (p *NetworkInfo) Extras() map[string]string {
	p.protect.RLock()
	defer p.protect.RUnlock()
	cloned := make(map[string]string, len(p.extras))
	for k, v := range p.extras {
		cloned[k] = v
	}
	return cloned
}