diff options
author | Tulir Asokan <tulir@maunium.net> | 2020-04-28 22:00:37 +0300 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2020-04-28 22:00:37 +0300 |
commit | fa04323daffb8bf783ba438065a5ce47b2994bea (patch) | |
tree | e1976c16a0bd40e3f3db895cc1d848ea3be97b1a /matrix | |
parent | 92d4279b216987ebdfbea4577965ffb192e7726a (diff) |
Update mautrix-go and move crypto store to XDG_DATA_HOME
Diffstat (limited to 'matrix')
-rw-r--r-- | matrix/matrix.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/matrix/matrix.go b/matrix/matrix.go index 3d1b279..8d7595e 100644 --- a/matrix/matrix.go +++ b/matrix/matrix.go @@ -135,7 +135,7 @@ func (c *Container) InitClient() error { c.client.Logger = mxLogger{} c.client.DeviceID = c.config.DeviceID - cryptoStore, err := crypto.NewGobStore(filepath.Join(c.config.CacheDir, "crypto.gob")) + cryptoStore, err := crypto.NewGobStore(filepath.Join(c.config.DataDir, "crypto.gob")) if err != nil { return err } @@ -281,8 +281,8 @@ func (c *Container) Login(user, password string) error { // Logout revokes the access token, stops the syncer and calls the OnLogout() method of the UI. func (c *Container) Logout() { c.client.Logout() - c.config.DeleteSession() c.Stop() + c.config.DeleteSession() c.client = nil c.crypto = nil c.ui.OnLogout() @@ -300,6 +300,11 @@ func (c *Container) Stop() { debug.Print("Error closing history manager:", err) } c.history = nil + debug.Print("Flushing crypto store") + err = c.crypto.Store.Flush() + if err != nil { + debug.Print("Error flushing crypto store:", err) + } } } @@ -558,7 +563,6 @@ func (c *Container) HandleEncrypted(source EventSource, mxEvent *event.Event) { debug.Print("Failed to decrypt event:", err) return } - debug.Print("!!!!!", evt) c.HandleMessage(source, evt) } |