mirror of
https://github.com/mautrix/discord.git
synced 2025-03-14 14:15:37 +00:00

So far this is passing my basic tests, but could use some testing from people that are much more familiar with how this is supposed to work. Refs #27
29 lines
600 B
Go
29 lines
600 B
Go
package config
|
|
|
|
type encryption struct {
|
|
Allow bool `yaml:"allow"`
|
|
Default bool `yaml:"default"`
|
|
|
|
KeySharing struct {
|
|
Allow bool `yaml:"allow"`
|
|
RequireCrossSigning bool `yaml:"require_cross_signing"`
|
|
RequireVerification bool `yaml:"require_verification"`
|
|
} `yaml:"key_sharing"`
|
|
}
|
|
|
|
func (e *encryption) validate() error {
|
|
return nil
|
|
}
|
|
|
|
func (e *encryption) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
|
type rawEncryption encryption
|
|
|
|
raw := rawEncryption{}
|
|
if err := unmarshal(&raw); err != nil {
|
|
return err
|
|
}
|
|
|
|
*e = encryption(raw)
|
|
|
|
return e.validate()
|
|
}
|