Fix keyring regressions in previous P2P demo

This commit is contained in:
Neil Alexander 2021-12-13 13:24:49 +00:00
parent c3dda0779d
commit 3113210f17
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
17 changed files with 71 additions and 88 deletions

View file

@ -73,18 +73,12 @@ func NewRoomserverAPI(
return a
}
// SetKeyring sets the keyring to a given keyring. This is only useful for the P2P
// demos and must be called after SetFederationSenderInputAPI.
func (r *RoomserverInternalAPI) SetKeyring(keyRing *gomatrixserverlib.KeyRing) {
r.KeyRing = keyRing
}
// SetFederationInputAPI passes in a federation input API reference so that we can
// avoid the chicken-and-egg problem of both the roomserver input API and the
// federation input API being interdependent.
func (r *RoomserverInternalAPI) SetFederationAPI(fsAPI fsAPI.FederationInternalAPI) {
func (r *RoomserverInternalAPI) SetFederationAPI(fsAPI fsAPI.FederationInternalAPI, keyRing *gomatrixserverlib.KeyRing) {
r.fsAPI = fsAPI
r.SetKeyring(fsAPI.KeyRing())
r.KeyRing = keyRing
r.Inviter = &perform.Inviter{
DB: r.DB,