This commit is contained in:
Tulir Asokan
2018-08-26 22:53:13 +03:00
parent 65f077c645
commit 22e76b6a37
14 changed files with 40 additions and 27 deletions

View File

@ -18,11 +18,12 @@ package config
import (
"bytes"
"text/template"
"maunium.net/go/mautrix-appservice"
"strings"
"strconv"
"strings"
"text/template"
"github.com/Rhymen/go-whatsapp"
"maunium.net/go/mautrix-appservice"
"maunium.net/go/mautrix-whatsapp/types"
)
@ -86,10 +87,10 @@ func (bc BridgeConfig) FormatUsername(receiver types.MatrixUserID, userID types.
func (bc BridgeConfig) MarshalYAML() (interface{}, error) {
bc.DisplaynameTemplate = bc.FormatDisplayname(whatsapp.Contact{
Jid: "{{.Jid}}",
Jid: "{{.Jid}}",
Notify: "{{.Notify}}",
Name: "{{.Name}}",
Short: "{{.Short}}",
Name: "{{.Name}}",
Short: "{{.Short}}",
})
bc.UsernameTemplate = bc.FormatUsername("{{.Receiver}}", "{{.UserID}}")
return bc, nil

View File

@ -17,9 +17,10 @@
package config
import (
"maunium.net/go/mautrix-appservice"
"io/ioutil"
"gopkg.in/yaml.v2"
"maunium.net/go/mautrix-appservice"
)
type Config struct {

View File

@ -17,9 +17,10 @@
package config
import (
"maunium.net/go/mautrix-appservice"
"regexp"
"fmt"
"regexp"
"maunium.net/go/mautrix-appservice"
)
func (config *Config) NewRegistration() (*appservice.Registration, error) {