Browse Source

make CHANTYPES a constant

tags/v1.2.0-rc1
Shivaram Lingamneni 4 years ago
parent
commit
1ce716582a
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      irc/server.go

+ 6
- 2
irc/server.go View File

42
 	// whitelist of caps to serve on the STS-only listener. In particular,
42
 	// whitelist of caps to serve on the STS-only listener. In particular,
43
 	// never advertise SASL, to discourage people from sending their passwords:
43
 	// never advertise SASL, to discourage people from sending their passwords:
44
 	stsOnlyCaps = caps.NewSet(caps.STS, caps.MessageTags, caps.ServerTime, caps.LabeledResponse, caps.Nope)
44
 	stsOnlyCaps = caps.NewSet(caps.STS, caps.MessageTags, caps.ServerTime, caps.LabeledResponse, caps.Nope)
45
+
46
+	// we only have standard channels for now. TODO: any updates to this
47
+	// will also need to be reflected in CasefoldChannel
48
+	chanTypes = "#"
45
 )
49
 )
46
 
50
 
47
 // ListenerWrapper wraps a listener so it can be safely reconfigured or stopped
51
 // ListenerWrapper wraps a listener so it can be safely reconfigured or stopped
137
 	isupport.Initialize()
141
 	isupport.Initialize()
138
 	isupport.Add("AWAYLEN", strconv.Itoa(config.Limits.AwayLen))
142
 	isupport.Add("AWAYLEN", strconv.Itoa(config.Limits.AwayLen))
139
 	isupport.Add("CASEMAPPING", "ascii")
143
 	isupport.Add("CASEMAPPING", "ascii")
140
-	isupport.Add("CHANLIMIT", fmt.Sprintf("#:%d", config.Channels.MaxChannelsPerClient))
144
+	isupport.Add("CHANLIMIT", fmt.Sprintf("%s:%d", chanTypes, config.Channels.MaxChannelsPerClient))
141
 	isupport.Add("CHANMODES", strings.Join([]string{modes.Modes{modes.BanMask, modes.ExceptMask, modes.InviteMask}.String(), "", modes.Modes{modes.UserLimit, modes.Key}.String(), modes.Modes{modes.InviteOnly, modes.Moderated, modes.NoOutside, modes.OpOnlyTopic, modes.ChanRoleplaying, modes.Secret}.String()}, ","))
145
 	isupport.Add("CHANMODES", strings.Join([]string{modes.Modes{modes.BanMask, modes.ExceptMask, modes.InviteMask}.String(), "", modes.Modes{modes.UserLimit, modes.Key}.String(), modes.Modes{modes.InviteOnly, modes.Moderated, modes.NoOutside, modes.OpOnlyTopic, modes.ChanRoleplaying, modes.Secret}.String()}, ","))
142
 	if config.History.Enabled && config.History.ChathistoryMax > 0 {
146
 	if config.History.Enabled && config.History.ChathistoryMax > 0 {
143
 		isupport.Add("draft/CHATHISTORY", strconv.Itoa(config.History.ChathistoryMax))
147
 		isupport.Add("draft/CHATHISTORY", strconv.Itoa(config.History.ChathistoryMax))
144
 	}
148
 	}
145
 	isupport.Add("CHANNELLEN", strconv.Itoa(config.Limits.ChannelLen))
149
 	isupport.Add("CHANNELLEN", strconv.Itoa(config.Limits.ChannelLen))
146
-	isupport.Add("CHANTYPES", "#")
150
+	isupport.Add("CHANTYPES", chanTypes)
147
 	isupport.Add("ELIST", "U")
151
 	isupport.Add("ELIST", "U")
148
 	isupport.Add("EXCEPTS", "")
152
 	isupport.Add("EXCEPTS", "")
149
 	isupport.Add("INVEX", "")
153
 	isupport.Add("INVEX", "")

Loading…
Cancel
Save