Set different user agent

This commit is contained in:
Tulir Asokan 2020-05-10 20:09:44 +03:00
parent 5a316b953f
commit 7d48d8538f
5 changed files with 9 additions and 1 deletions

2
go.mod
View File

@ -22,7 +22,7 @@ require (
golang.org/x/net v0.0.0-20200505041828-1ed23360d12c
gopkg.in/toast.v1 v1.0.0-20180812000517-0a84660828b2
gopkg.in/yaml.v2 v2.2.8
maunium.net/go/mautrix v0.4.1
maunium.net/go/mautrix v0.4.2
maunium.net/go/mauview v0.1.1
maunium.net/go/tcell v0.2.0
)

2
go.sum
View File

@ -103,6 +103,8 @@ maunium.net/go/mautrix v0.3.4 h1:0X8VPXqG2i1nh/P5J0ZRu8ioed6hwK5SBBEQkUuFb68=
maunium.net/go/mautrix v0.3.4/go.mod h1:SkGZzch8CvU2qKtNpYxtzZ0sQxfVEJ3IsVVLSUBUx9Y=
maunium.net/go/mautrix v0.4.1 h1:i2lJNT+TE4AAL3cVKUN4jKVRkujCE/oS8aIsj8+7iNE=
maunium.net/go/mautrix v0.4.1/go.mod h1:8Y+NqmROJyWYvvP4yPfX9tLM59VCfgE/kcQ0SeX68ho=
maunium.net/go/mautrix v0.4.2 h1:GBU++Z7o/fLPcEsNMkNOUsnDknwV/MGPQ0BN4ikK6tw=
maunium.net/go/mautrix v0.4.2/go.mod h1:8Y+NqmROJyWYvvP4yPfX9tLM59VCfgE/kcQ0SeX68ho=
maunium.net/go/mauview v0.1.0 h1:x2WdkKI2zdriJuPAB0CKlwmnHGE7W9xfM5z6RgG+IIg=
maunium.net/go/mauview v0.1.0/go.mod h1:og9WbzmWe9SNYNyOFlCv8qa9zMcOvG2nzRJ5vYyud9U=
maunium.net/go/mauview v0.1.1 h1:wfTXyPx3LGAGpTskh+UbBv/QItUWnEpaneHmywoYnfY=

View File

@ -55,6 +55,10 @@ func NewGomuks(uiProvider ifc.UIProvider, configDir, dataDir, cacheDir, download
return gmx
}
func (gmx *Gomuks) Version() string {
return "v0.1.0"
}
// Save saves the active session and message history.
func (gmx *Gomuks) Save() {
gmx.config.SaveAll()

View File

@ -25,6 +25,7 @@ type Gomuks interface {
Matrix() MatrixContainer
UI() GomuksUI
Config() *config.Config
Version() string
Start()
Stop(save bool)

View File

@ -117,6 +117,7 @@ func (c *Container) InitClient() error {
if err != nil {
return err
}
c.client.UserAgent = fmt.Sprintf("gomuks %s (with mautrix-go %s)", c.gmx.Version(), mautrix.Version)
c.client.Logger = mxLogger{}
c.client.DeviceID = c.config.DeviceID