diff --git a/config/config.go b/config/config.go index 3956e40..e2df2ac 100644 --- a/config/config.go +++ b/config/config.go @@ -68,8 +68,8 @@ type Config struct { } `yaml:"metrics"` WhatsApp struct { - DeviceName string `yaml:"device_name"` - ShortName string `yaml:"short_name"` + OSName string `yaml:"os_name"` + BrowserName string `yaml:"browser_name"` } `yaml:"whatsapp"` Bridge BridgeConfig `yaml:"bridge"` @@ -80,8 +80,8 @@ type Config struct { func (config *Config) setDefaults() { config.AppService.Database.MaxOpenConns = 20 config.AppService.Database.MaxIdleConns = 2 - config.WhatsApp.DeviceName = "Mautrix-WhatsApp bridge" - config.WhatsApp.ShortName = "mx-wa" + config.WhatsApp.OSName = "Mautrix-WhatsApp bridge" + config.WhatsApp.BrowserName = "mx-wa" config.Bridge.setDefaults() } diff --git a/example-config.yaml b/example-config.yaml index d496ae4..65bc6c6 100644 --- a/example-config.yaml +++ b/example-config.yaml @@ -56,9 +56,11 @@ metrics: listen: 127.0.0.1:8001 whatsapp: - # Device name that's shown in the "WhatsApp Web" section in the mobile app - device_name: Mautrix-WhatsApp bridge - short_name: mx-wa + # Device name that's shown in the "WhatsApp Web" section in the mobile app. + os_name: Mautrix-WhatsApp bridge + # Browser name that determines the logo shown in the mobile app. If the name is unrecognized, a generic icon is shown. + # Use the name of an actual browser (Chrome, Firefox, Safari, IE, Edge, Opera) if you want a specific icon. + browser_name: mx-wa # Bridge config bridge: diff --git a/go.mod b/go.mod index ea7e286..3324082 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( gopkg.in/yaml.v2 v2.3.0 maunium.net/go/mauflag v1.0.0 maunium.net/go/maulogger/v2 v2.1.1 - maunium.net/go/mautrix v0.7.2 + maunium.net/go/mautrix v0.7.4 ) -replace github.com/Rhymen/go-whatsapp => github.com/tulir/go-whatsapp v0.3.7 +replace github.com/Rhymen/go-whatsapp => github.com/tulir/go-whatsapp v0.3.8 diff --git a/go.sum b/go.sum index c1882fd..d790c31 100644 --- a/go.sum +++ b/go.sum @@ -123,6 +123,8 @@ github.com/tulir/go-whatsapp v0.3.6 h1:RtyNh8TFX48ClMvi2J8oS3qmH7b1t9SIKA5jucG2l github.com/tulir/go-whatsapp v0.3.6/go.mod h1:7yGOBdWidM6gsmbAFwgkwHEIhzVrm01+6UbImpMWfTM= github.com/tulir/go-whatsapp v0.3.7 h1:6YoHsAlO+Y1SnU0bOntDmuvJQziEnBjFKO+1fOH2VIw= github.com/tulir/go-whatsapp v0.3.7/go.mod h1:7yGOBdWidM6gsmbAFwgkwHEIhzVrm01+6UbImpMWfTM= +github.com/tulir/go-whatsapp v0.3.8 h1:cRPyYhtgokUyeE2wsSlRpsw9qddi0Giun+kn9fGsl/M= +github.com/tulir/go-whatsapp v0.3.8/go.mod h1:7yGOBdWidM6gsmbAFwgkwHEIhzVrm01+6UbImpMWfTM= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9 h1:vEg9joUBmeBcK9iSJftGNf3coIG4HqZElCPehJsfAYM= @@ -223,3 +225,5 @@ maunium.net/go/mautrix v0.7.0 h1:9Wxs5S4Wl4S99dbBwfLZYAe/sP7VKaFikw9Ocf88kfk= maunium.net/go/mautrix v0.7.0/go.mod h1:Va/74MijqaS0DQ3aUqxmFO54/PMfr1LVsCOcGRHbYmo= maunium.net/go/mautrix v0.7.2 h1:ru//jj7Y5Xj9CXBpeNyWCoxjq8iT0d+a2lNeSiN9P/o= maunium.net/go/mautrix v0.7.2/go.mod h1:Va/74MijqaS0DQ3aUqxmFO54/PMfr1LVsCOcGRHbYmo= +maunium.net/go/mautrix v0.7.4 h1:MDjrvDyHcu5ozKAa80ohcXmYAXZTHgHxrhiERtvkEdY= +maunium.net/go/mautrix v0.7.4/go.mod h1:Va/74MijqaS0DQ3aUqxmFO54/PMfr1LVsCOcGRHbYmo= diff --git a/user.go b/user.go index 73153e9..bb0da15 100644 --- a/user.go +++ b/user.go @@ -240,7 +240,7 @@ func (user *User) Connect(evenIfNoSession bool) bool { return false } user.Conn = whatsappExt.ExtendConn(conn) - _ = user.Conn.SetClientName(user.bridge.Config.WhatsApp.DeviceName, user.bridge.Config.WhatsApp.ShortName, WAVersion) + _ = user.Conn.SetClientName(user.bridge.Config.WhatsApp.OSName, user.bridge.Config.WhatsApp.BrowserName, WAVersion) user.log.Debugln("WhatsApp connection successful") user.Conn.AddHandler(user) return user.RestoreSession()