|
@@ -258,6 +258,8 @@ func NewServer(configFilename string, config *Config) *Server {
|
258
|
258
|
|
259
|
259
|
// setISupport sets up our RPL_ISUPPORT reply.
|
260
|
260
|
func (server *Server) setISupport() {
|
|
261
|
+ maxTargetsString := strconv.Itoa(maxTargets)
|
|
262
|
+
|
261
|
263
|
// add RPL_ISUPPORT tokens
|
262
|
264
|
server.isupport = NewISupportList()
|
263
|
265
|
server.isupport.Add("AWAYLEN", strconv.Itoa(server.limits.AwayLen))
|
|
@@ -269,14 +271,14 @@ func (server *Server) setISupport() {
|
269
|
271
|
server.isupport.Add("INVEX", "")
|
270
|
272
|
server.isupport.Add("KICKLEN", strconv.Itoa(server.limits.KickLen))
|
271
|
273
|
server.isupport.Add("MAXLIST", fmt.Sprintf("beI:%s", strconv.Itoa(server.limits.ChanListModes)))
|
272
|
|
- server.isupport.Add("MAXTARGETS", "4")
|
|
274
|
+ server.isupport.Add("MAXTARGETS", maxTargetsString)
|
273
|
275
|
server.isupport.Add("MODES", "")
|
274
|
276
|
server.isupport.Add("MONITOR", strconv.Itoa(server.limits.MonitorEntries))
|
275
|
277
|
server.isupport.Add("NETWORK", server.networkName)
|
276
|
278
|
server.isupport.Add("NICKLEN", strconv.Itoa(server.limits.NickLen))
|
277
|
279
|
server.isupport.Add("PREFIX", "(qaohv)~&@%+")
|
278
|
280
|
server.isupport.Add("STATUSMSG", "~&@%+")
|
279
|
|
- server.isupport.Add("TARGMAX", "NAMES:1,LIST:1,KICK:1,WHOIS:1,PRIVMSG:4,NOTICE:4,MONITOR:")
|
|
281
|
+ server.isupport.Add("TARGMAX", fmt.Sprintf("NAMES:1,LIST:1,KICK:1,WHOIS:1,PRIVMSG:%s,NOTICE:%s,MONITOR:", maxTargetsString, maxTargetsString))
|
280
|
282
|
server.isupport.Add("TOPICLEN", strconv.Itoa(server.limits.TopicLen))
|
281
|
283
|
|
282
|
284
|
// account registration
|
|
@@ -740,7 +742,11 @@ func privmsgHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool
|
740
|
742
|
targets := strings.Split(msg.Params[0], ",")
|
741
|
743
|
message := msg.Params[1]
|
742
|
744
|
|
743
|
|
- for _, targetString := range targets[:4] {
|
|
745
|
+ for i, targetString := range targets {
|
|
746
|
+ // max of four targets per privmsg
|
|
747
|
+ if i > maxTargets-1 {
|
|
748
|
+ break
|
|
749
|
+ }
|
744
|
750
|
prefixes, targetString := SplitChannelMembershipPrefixes(targetString)
|
745
|
751
|
lowestPrefix := GetLowestChannelModePrefix(prefixes)
|
746
|
752
|
|
|
@@ -1220,7 +1226,11 @@ func noticeHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
1220
|
1226
|
targets := strings.Split(msg.Params[0], ",")
|
1221
|
1227
|
message := msg.Params[1]
|
1222
|
1228
|
|
1223
|
|
- for _, targetString := range targets[:4] {
|
|
1229
|
+ for i, targetString := range targets {
|
|
1230
|
+ // max of four targets per privmsg
|
|
1231
|
+ if i > maxTargets-1 {
|
|
1232
|
+ break
|
|
1233
|
+ }
|
1224
|
1234
|
prefixes, targetString := SplitChannelMembershipPrefixes(targetString)
|
1225
|
1235
|
lowestPrefix := GetLowestChannelModePrefix(prefixes)
|
1226
|
1236
|
|