add additional noting in regards to channel id lengths and ISUPPORT
This commit is contained in:
parent
01fc509fc2
commit
f50ede5a58
@ -105,7 +105,10 @@ func StripRaw(text string) string {
|
|||||||
|
|
||||||
// IsValidChannel validates if channel is an RFC complaint channel or not.
|
// IsValidChannel validates if channel is an RFC complaint channel or not.
|
||||||
//
|
//
|
||||||
// NOTE: If you do not need to validate against servers that support Unicode,
|
// NOTE: If you are using this to validate a channel that contains a channel
|
||||||
|
// ID, (!<channelid>NAME), this only supports the standard 5 character length.
|
||||||
|
//
|
||||||
|
// NOTE: If you do not need to validate against servers that support unicode,
|
||||||
// you may want to ensure that all channel chars are within the range of
|
// you may want to ensure that all channel chars are within the range of
|
||||||
// all ASCII printable chars. This function will NOT do that for
|
// all ASCII printable chars. This function will NOT do that for
|
||||||
// compatibility reasons.
|
// compatibility reasons.
|
||||||
@ -130,6 +133,8 @@ func IsValidChannel(channel string) bool {
|
|||||||
// !<channelid> -- not very commonly supported, but we'll check it anyway.
|
// !<channelid> -- not very commonly supported, but we'll check it anyway.
|
||||||
// The ID must be 5 chars. This means min-channel size should be:
|
// The ID must be 5 chars. This means min-channel size should be:
|
||||||
// 1 (prefix) + 5 (id) + 1 (+, channel name)
|
// 1 (prefix) + 5 (id) + 1 (+, channel name)
|
||||||
|
// On some networks, this may be extended with ISUPPORT capabilities,
|
||||||
|
// however this is extremely uncommon.
|
||||||
if channel[0] == 0x21 {
|
if channel[0] == 0x21 {
|
||||||
if len(channel) < 7 {
|
if len(channel) < 7 {
|
||||||
return false
|
return false
|
||||||
|
Loading…
Reference in New Issue
Block a user