Merge pull request 'PublishServerUpdate error' (#536) from stable-blockers into master
continuous-integration/drone/push Build is pending Details

Reviewed-on: #536
Reviewed-by: Dan Ballard <dan@openprivacy.ca>
This commit is contained in:
Sarah Jamie Lewis 2023-09-26 20:12:48 +00:00
commit 657fb76b04
2 changed files with 5 additions and 3 deletions

View File

@ -415,10 +415,11 @@ func (app *application) ConfigureConnections(onion string, listen bool, peers bo
profile.Listen()
}
app.eventBuses[profile.GetOnion()].Publish(event.NewEventList(event.ResumeRetries))
// do this in the background, for large contact lists it can take a long time...
go profile.StartConnections(peers, servers)
} else {
log.Errorf("profile does not exist %v", onion)
}
}

View File

@ -87,10 +87,11 @@ type Server struct {
}
// PublishServerUpdate serializes the current list of group servers and publishes an event with this information
func (f *Functionality) PublishServerUpdate(profile peer.CwtchPeer) {
func (f *Functionality) PublishServerUpdate(profile peer.CwtchPeer) error {
serverListForOnion := f.GetServerInfoList(profile)
serversListBytes, _ := json.Marshal(serverListForOnion)
serversListBytes, err := json.Marshal(serverListForOnion)
profile.PublishEvent(event.NewEvent(UpdateServerInfo, map[event.Field]string{"ProfileOnion": profile.GetOnion(), ServerList: string(serversListBytes)}))
return err
}
// GetServerInfoList compiles all the information the UI might need regarding all servers..