Browse Source

Also log when clients are created

pull/137/head
Kegan Dougal 8 years ago
parent
commit
8d75494c19
  1. 12
      src/github.com/matrix-org/go-neb/clients/clients.go

12
src/github.com/matrix-org/go-neb/clients/clients.go

@ -330,12 +330,13 @@ func (c *Clients) newClient(config api.ClientConfig) (*gomatrix.Client, error) {
}
client.Client = c.httpClient
syncer := client.Syncer.(*gomatrix.DefaultSyncer)
client.Store = &matrix.NEBStore{
nebStore := &matrix.NEBStore{
InMemoryStore: *gomatrix.NewInMemoryStore(),
Database: c.db,
ClientConfig: config,
}
syncer.Store = client.Store
client.Store = nebStore
syncer.Store = nebStore
// TODO: Check that the access token is valid for the userID by peforming
// a request against the server.
@ -354,6 +355,13 @@ func (c *Clients) newClient(config api.ClientConfig) (*gomatrix.Client, error) {
})
}
log.WithFields(log.Fields{
"user_id": config.UserID,
"sync": config.Sync,
"auto_join_rooms": config.AutoJoinRooms,
"since": nebStore.LoadNextBatch(config.UserID),
}).Info("Created new client")
if config.Sync {
go func() {
for {

Loading…
Cancel
Save