From f890cc9fa402dd548a0850a2e8aabaab7625fe47 Mon Sep 17 00:00:00 2001 From: Nikos Filippakis Date: Fri, 12 Jun 2020 16:43:05 +0200 Subject: [PATCH] Add device ID to the configuration Signed-off-by: Nikos Filippakis --- api/api.go | 2 ++ clients/clients.go | 1 + 2 files changed, 3 insertions(+) diff --git a/api/api.go b/api/api.go index 01ca8c1..2b2f6de 100644 --- a/api/api.go +++ b/api/api.go @@ -63,6 +63,8 @@ type ClientConfig struct { HomeserverURL string // The matrix access token to authenticate the requests with. AccessToken string + // The device ID for this access token. + DeviceID id.DeviceID // True to start a sync stream for this user, making this a "syncing client". If false, no // /sync goroutine will be created and this client won't listen for new events from Matrix. For services // which only SEND events into Matrix, it may be desirable to set Sync to false to reduce the diff --git a/clients/clients.go b/clients/clients.go index fc2c285..6d7e502 100644 --- a/clients/clients.go +++ b/clients/clients.go @@ -347,6 +347,7 @@ func (c *Clients) newClient(config api.ClientConfig) (*mautrix.Client, error) { return nil, err } client.Client = c.httpClient + client.DeviceID = config.DeviceID syncer := client.Syncer.(*mautrix.DefaultSyncer) nebStore := &matrix.NEBStore{ InMemoryStore: *mautrix.NewInMemoryStore(),