summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/lrstanley/girc/cap.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/lrstanley/girc/cap.go')
-rw-r--r--vendor/github.com/lrstanley/girc/cap.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/vendor/github.com/lrstanley/girc/cap.go b/vendor/github.com/lrstanley/girc/cap.go
index a63dfe9d..1d50460f 100644
--- a/vendor/github.com/lrstanley/girc/cap.go
+++ b/vendor/github.com/lrstanley/girc/cap.go
@@ -375,11 +375,11 @@ func handleTags(c *Client, e Event) {
}
const (
- prefixTag byte = 0x40 // @
- prefixTagValue byte = 0x3D // =
- prefixUserTag byte = 0x2B // +
- tagSeparator byte = 0x3B // ;
- maxTagLength int = 511 // 510 + @ and " " (space), though space usually not included.
+ prefixTag byte = '@'
+ prefixTagValue byte = '='
+ prefixUserTag byte = '+'
+ tagSeparator byte = ';'
+ maxTagLength int = 511 // 510 + @ and " " (space), though space usually not included.
)
// Tags represents the key-value pairs in IRCv3 message tags. The map contains
@@ -618,7 +618,7 @@ func validTag(name string) bool {
for i := 0; i < len(name); i++ {
// A-Z, a-z, 0-9, -/._
- if (name[i] < 0x41 || name[i] > 0x5A) && (name[i] < 0x61 || name[i] > 0x7A) && (name[i] < 0x2D || name[i] > 0x39) && name[i] != 0x5F {
+ if (name[i] < 'A' || name[i] > 'Z') && (name[i] < 'a' || name[i] > 'z') && (name[i] < '-' || name[i] > '9') && name[i] != '_' {
return false
}
}
@@ -631,7 +631,7 @@ func validTag(name string) bool {
func validTagValue(value string) bool {
for i := 0; i < len(value); i++ {
// Don't allow any invisible chars within the tag, or semicolons.
- if value[i] < 0x21 || value[i] > 0x7E || value[i] == 0x3B {
+ if value[i] < '!' || value[i] > '~' || value[i] == ';' {
return false
}
}