Don't rewrite name templates when saving config
Advanced template stuff isn't preserved if you execute them
This commit is contained in:
parent
4e03361df6
commit
a19239b936
@ -86,17 +86,6 @@ func (bc BridgeConfig) FormatUsername(userID types.WhatsAppID) string {
|
|||||||
return buf.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 PermissionConfig map[string]PermissionLevel
|
||||||
|
|
||||||
type PermissionLevel int
|
type PermissionLevel int
|
||||||
|
Loading…
Reference in New Issue
Block a user