From 987c21ccf9e22825061b02f0786e6893fe7cbc06 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Tue, 25 Oct 2022 13:36:51 +0100 Subject: [PATCH] Fix federation API condition --- federationapi/federationapi_keys_test.go | 1 - federationapi/internal/keys.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/federationapi/federationapi_keys_test.go b/federationapi/federationapi_keys_test.go index 787bb9945..7ccc02f76 100644 --- a/federationapi/federationapi_keys_test.go +++ b/federationapi/federationapi_keys_test.go @@ -209,7 +209,6 @@ func TestRenewalBehaviour(t *testing.T) { // then repeating a key fetch should cause us to try and renew the key. // If so, then the new key will end up in our cache. serverC.renew() - time.Sleep(time.Second / 2) res, err = serverA.api.FetchKeys( context.Background(), diff --git a/federationapi/internal/keys.go b/federationapi/internal/keys.go index 05612494f..258bd88bf 100644 --- a/federationapi/internal/keys.go +++ b/federationapi/internal/keys.go @@ -99,7 +99,7 @@ func (s *FederationInternalAPI) handleLocalKeys( results map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult, ) { for req := range requests { - if s.cfg.Matrix.IsLocalServerName(req.ServerName) { + if !s.cfg.Matrix.IsLocalServerName(req.ServerName) { continue } if req.KeyID == s.cfg.Matrix.KeyID {