Experiments Update on Load

This commit is contained in:
Sarah Jamie Lewis 2023-02-27 12:01:54 -08:00
parent 195e048410
commit 05e77604d2
1 changed files with 5 additions and 1 deletions

View File

@ -312,10 +312,14 @@ func (app *application) installProfile(profile peer.CwtchPeer) bool {
if app.peers[profile.GetOnion()] == nil {
eventBus := event.NewEventManager()
app.eventBuses[profile.GetOnion()] = eventBus
profile.Init(app.eventBuses[profile.GetOnion()])
app.registerHooks(profile)
profile.Init(app.eventBuses[profile.GetOnion()])
app.peers[profile.GetOnion()] = profile
// Update the Peer with the Most Recent Experiment State...
settings := app.settings.ReadGlobalSettings()
profile.UpdateExperiments(settings.ExperimentsEnabled, settings.Experiments)
app.AddPeerPlugin(profile.GetOnion(), plugins.CONNECTIONRETRY) // Now Mandatory
app.appBus.Publish(event.NewEvent(event.NewPeer, map[event.Field]string{event.Identity: profile.GetOnion(), event.Created: event.False}))