From cfd5f7ae54fa2f4a21236665c9e685a3fabde5b6 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Tue, 5 May 2020 21:15:53 +0300 Subject: Random changes --- matrix/crypto.go | 3 ++- matrix/matrix.go | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'matrix') diff --git a/matrix/crypto.go b/matrix/crypto.go index 1fc5674..8eab355 100644 --- a/matrix/crypto.go +++ b/matrix/crypto.go @@ -21,8 +21,9 @@ package matrix import ( "path/filepath" - "maunium.net/go/gomuks/debug" "maunium.net/go/mautrix/crypto" + + "maunium.net/go/gomuks/debug" ) type cryptoLogger struct{} diff --git a/matrix/matrix.go b/matrix/matrix.go index 4ea6bd2..30e28fb 100644 --- a/matrix/matrix.go +++ b/matrix/matrix.go @@ -346,7 +346,11 @@ func (c *Container) OnLogin() { if c.crypto != nil { c.syncer.OnSync(c.crypto.ProcessSyncResponse) c.syncer.OnEventType(event.StateMember, func(source EventSource, evt *event.Event) { - c.crypto.HandleMemberEvent(evt) + // Don't spam the crypto module with member events of an initial sync + // TODO invalidate all group sessions when clearing cache? + if c.config.AuthCache.InitialSyncDone { + c.crypto.HandleMemberEvent(evt) + } }) c.syncer.OnEventType(event.EventEncrypted, c.HandleEncrypted) } else { -- cgit v1.2.3