Don't rewrite name templates when saving config

Advanced template stuff isn't preserved if you execute them
This commit is contained in:
Tulir Asokan 2018-10-23 18:22:58 +03:00 committed by GitHub
parent 4e03361df6
commit a19239b936

View file

@ -86,17 +86,6 @@ func (bc BridgeConfig) FormatUsername(userID types.WhatsAppID) string {
return buf.String()
}
func (bc BridgeConfig) MarshalYAML() (interface{}, error) {
bc.DisplaynameTemplate, _ = bc.FormatDisplayname(whatsapp.Contact{
Jid: "{{.Jid}}",
Notify: "{{.Notify}}",
Name: "{{.Name}}",
Short: "{{.Short}}",
})
bc.UsernameTemplate = bc.FormatUsername("{{.}}")
return bc, nil
}
type PermissionConfig map[string]PermissionLevel
type PermissionLevel int