aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorDevon Hudson <devonhudson@librem.one>2023-01-29 12:26:16 -0700
committerDevon Hudson <devonhudson@librem.one>2023-01-29 12:26:16 -0700
commit0f998e3af3be06a1f0626de8cb74413c5da310f4 (patch)
tree34b439398155566574445a23ec8974a2a543556c /build
parent63df85db6d5bc528a784dc52e550fc64385c5f67 (diff)
Add pinecone demo toggle for dis/enabling relaying for other nodes
Diffstat (limited to 'build')
-rw-r--r--build/gobind-pinecone/monolith.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/build/gobind-pinecone/monolith.go b/build/gobind-pinecone/monolith.go
index 5e8e5875..a219621b 100644
--- a/build/gobind-pinecone/monolith.go
+++ b/build/gobind-pinecone/monolith.go
@@ -90,6 +90,7 @@ type DendriteMonolith struct {
httpServer *http.Server
userAPI userapiAPI.UserInternalAPI
federationAPI api.FederationInternalAPI
+ relayAPI relayServerAPI.RelayInternalAPI
relayRetriever RelayServerRetriever
}
@@ -313,6 +314,14 @@ func (m *DendriteMonolith) GetRelayServers(nodeID string) string {
return relaysString
}
+func (m *DendriteMonolith) RelayingEnabled() bool {
+ return m.relayAPI.RelayingEnabled()
+}
+
+func (m *DendriteMonolith) SetRelayingEnabled(enabled bool) {
+ m.relayAPI.SetRelayingEnabled(enabled)
+}
+
func (m *DendriteMonolith) DisconnectType(peertype int) {
for _, p := range m.PineconeRouter.Peers() {
if int(peertype) == p.PeerType {
@@ -528,7 +537,7 @@ func (m *DendriteMonolith) Start() {
Config: &base.Cfg.FederationAPI,
UserAPI: m.userAPI,
}
- relayAPI := relayapi.NewRelayInternalAPI(base, federation, rsAPI, keyRing, producer)
+ m.relayAPI = relayapi.NewRelayInternalAPI(base, federation, rsAPI, keyRing, producer, false)
monolith := setup.Monolith{
Config: base.Cfg,
@@ -541,7 +550,7 @@ func (m *DendriteMonolith) Start() {
RoomserverAPI: rsAPI,
UserAPI: m.userAPI,
KeyAPI: keyAPI,
- RelayAPI: relayAPI,
+ RelayAPI: m.relayAPI,
ExtPublicRoomsProvider: roomProvider,
ExtUserDirectoryProvider: userProvider,
}