From 7d48d8538f907f4663771ee49cd18efc8bf6585e Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sun, 10 May 2020 20:09:44 +0300 Subject: Set different user agent --- go.mod | 2 +- go.sum | 2 ++ gomuks.go | 4 ++++ interface/gomuks.go | 1 + matrix/matrix.go | 1 + 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 326db7e..a07e991 100644 --- a/go.mod +++ b/go.mod @@ -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 ) diff --git a/go.sum b/go.sum index baf1993..65d5c4b 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/gomuks.go b/gomuks.go index d61fe57..d5a7458 100644 --- a/gomuks.go +++ b/gomuks.go @@ -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() diff --git a/interface/gomuks.go b/interface/gomuks.go index ada1b87..e269071 100644 --- a/interface/gomuks.go +++ b/interface/gomuks.go @@ -25,6 +25,7 @@ type Gomuks interface { Matrix() MatrixContainer UI() GomuksUI Config() *config.Config + Version() string Start() Stop(save bool) diff --git a/matrix/matrix.go b/matrix/matrix.go index bff9bd2..1407125 100644 --- a/matrix/matrix.go +++ b/matrix/matrix.go @@ -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 -- cgit v1.2.3