mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
implement metadata before-connect (#2281)
* metadata spec update: disallow colon entirely * refactor key validation * implement metadata before-connect * play the metadata in reg burst to all clients with the cap * bump irctest * remove all case normalization for keys From spec discussion, we will most likely either require keys to be lowercase, or else treat them as case-opaque, similar to message tag keys.
This commit is contained in:
parent
a5e435a26b
commit
73e51333ad
10 changed files with 199 additions and 59 deletions
|
|
@ -724,7 +724,6 @@ type Config struct {
|
|||
}
|
||||
|
||||
Metadata struct {
|
||||
// BeforeConnect int `yaml:"before-connect"` todo: this
|
||||
Enabled bool
|
||||
MaxSubs int `yaml:"max-subs"`
|
||||
MaxKeys int `yaml:"max-keys"`
|
||||
|
|
@ -1648,7 +1647,8 @@ func LoadConfig(filename string) (config *Config, err error) {
|
|||
if !config.Metadata.Enabled {
|
||||
config.Server.supportedCaps.Disable(caps.Metadata)
|
||||
} else {
|
||||
var metadataValues []string
|
||||
metadataValues := make([]string, 0, 4)
|
||||
metadataValues = append(metadataValues, "before-connect")
|
||||
// these are required for normal operation, so set sane defaults:
|
||||
if config.Metadata.MaxSubs == 0 {
|
||||
config.Metadata.MaxSubs = 10
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue