Implement ExtraPublicRoomsProvider for p2p demos (#1180)

* Change API and rename to ExtraPublicRoomsProvider

* Make dendritejs work again

* Maybe make libp2p demo work again

* Linting
This commit is contained in:
Kegsay 2020-07-03 12:59:00 +01:00 committed by GitHub
parent 1773fd84b7
commit 6c4b8185d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 433 additions and 250 deletions

View file

@ -14,9 +14,10 @@
package api
type ExternalPublicRoomsProvider interface {
// The list of homeserver domains to query. These servers will receive a request
// via this API: https://matrix.org/docs/spec/server_server/latest#public-room-directory
// This will be called -on demand- by clients, so cache appropriately!
Homeservers() []string
import "github.com/matrix-org/gomatrixserverlib"
// ExtraPublicRoomsProvider provides a way to inject extra published rooms into /publicRooms requests.
type ExtraPublicRoomsProvider interface {
// Rooms returns the extra rooms. This is called on-demand by clients, so cache appropriately.
Rooms() []gomatrixserverlib.PublicRoom
}