|
@@ -6,7 +6,6 @@ package irc
|
6
|
6
|
import "fmt"
|
7
|
7
|
|
8
|
8
|
const isupportSupportedString = "are supported by this server"
|
9
|
|
-const maxISupportLength = 400 // Max length of a single ISUPPORT token line
|
10
|
9
|
|
11
|
10
|
// ISupportList holds a list of ISUPPORT tokens
|
12
|
11
|
type ISupportList struct {
|
|
@@ -55,7 +54,7 @@ func (il *ISupportList) GetDifference(newil *ISupportList) [][]string {
|
55
|
54
|
|
56
|
55
|
token := fmt.Sprintf("-%s", name)
|
57
|
56
|
|
58
|
|
- if len(token)+length <= maxISupportLength {
|
|
57
|
+ if len(token)+length <= maxLastArgLength {
|
59
|
58
|
// account for the space separating tokens
|
60
|
59
|
if len(cache) > 0 {
|
61
|
60
|
length++
|
|
@@ -64,7 +63,7 @@ func (il *ISupportList) GetDifference(newil *ISupportList) [][]string {
|
64
|
63
|
length += len(token)
|
65
|
64
|
}
|
66
|
65
|
|
67
|
|
- if len(cache) == 13 || len(token)+length >= maxISupportLength {
|
|
66
|
+ if len(cache) == 13 || len(token)+length >= maxLastArgLength {
|
68
|
67
|
cache = append(cache, isupportSupportedString)
|
69
|
68
|
replies = append(replies, cache)
|
70
|
69
|
cache = make([]string, 0)
|
|
@@ -81,7 +80,7 @@ func (il *ISupportList) GetDifference(newil *ISupportList) [][]string {
|
81
|
80
|
|
82
|
81
|
token := getTokenString(name, value)
|
83
|
82
|
|
84
|
|
- if len(token)+length <= maxISupportLength {
|
|
83
|
+ if len(token)+length <= maxLastArgLength {
|
85
|
84
|
// account for the space separating tokens
|
86
|
85
|
if len(cache) > 0 {
|
87
|
86
|
length++
|
|
@@ -90,7 +89,7 @@ func (il *ISupportList) GetDifference(newil *ISupportList) [][]string {
|
90
|
89
|
length += len(token)
|
91
|
90
|
}
|
92
|
91
|
|
93
|
|
- if len(cache) == 13 || len(token)+length >= maxISupportLength {
|
|
92
|
+ if len(cache) == 13 || len(token)+length >= maxLastArgLength {
|
94
|
93
|
cache = append(cache, isupportSupportedString)
|
95
|
94
|
replies = append(replies, cache)
|
96
|
95
|
cache = make([]string, 0)
|
|
@@ -115,7 +114,7 @@ func (il *ISupportList) RegenerateCachedReply() {
|
115
|
114
|
for name, value := range il.Tokens {
|
116
|
115
|
token := getTokenString(name, value)
|
117
|
116
|
|
118
|
|
- if len(token)+length <= maxISupportLength {
|
|
117
|
+ if len(token)+length <= maxLastArgLength {
|
119
|
118
|
// account for the space separating tokens
|
120
|
119
|
if len(cache) > 0 {
|
121
|
120
|
length++
|
|
@@ -124,7 +123,7 @@ func (il *ISupportList) RegenerateCachedReply() {
|
124
|
123
|
length += len(token)
|
125
|
124
|
}
|
126
|
125
|
|
127
|
|
- if len(cache) == 13 || len(token)+length >= maxISupportLength {
|
|
126
|
+ if len(cache) == 13 || len(token)+length >= maxLastArgLength {
|
128
|
127
|
cache = append(cache, isupportSupportedString)
|
129
|
128
|
il.CachedReply = append(il.CachedReply, cache)
|
130
|
129
|
cache = make([]string, 0)
|