From a19239b936bc2ec0815569dd2943d9a1d4d49b2f Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Tue, 23 Oct 2018 18:22:58 +0300 Subject: [PATCH] Don't rewrite name templates when saving config Advanced template stuff isn't preserved if you execute them --- config/bridge.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/config/bridge.go b/config/bridge.go index dff33e4..1684c23 100644 --- a/config/bridge.go +++ b/config/bridge.go @@ -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