Merge pull request 'on createServer autostart after create' (#39) from autolaunchAfterCreate into trunk
continuous-integration/drone/push Build is passing Details

Reviewed-on: #39
Reviewed-by: Sarah Jamie Lewis <sarah@openprivacy.ca>
This commit is contained in:
Sarah Jamie Lewis 2021-11-03 18:58:54 +00:00
commit f3463d54d3
1 changed files with 3 additions and 1 deletions

4
lib.go
View File

@ -1018,7 +1018,6 @@ func CreateServer(password string, description string, autostart bool) {
s.SetAttribute(server.AttrDescription, description)
if autostart {
s.SetAttribute(server.AttrAutostart, "true")
LaunchServer(s.Onion())
} else {
s.SetAttribute(server.AttrAutostart, "false")
}
@ -1032,6 +1031,9 @@ func CreateServer(password string, description string, autostart bool) {
ev := event.NewEvent(servers.NewServer, make(map[event.Field]string))
serverInfo.EnrichEvent(&ev)
application.GetPrimaryBus().Publish(ev)
if autostart {
LaunchServer(s.Onion())
}
}
}
}