forked from cwtch.im/cwtch
Merge branch 'clifix' of cwtch.im/cwtch into master
This commit is contained in:
commit
f217533044
13
app/app.go
13
app/app.go
|
@ -70,12 +70,15 @@ func (app *Application) startTor(torPath string) error {
|
||||||
|
|
||||||
// SetProfile loads an existing profile from the given filename.
|
// SetProfile loads an existing profile from the given filename.
|
||||||
func (app *Application) SetProfile(filename string, password string) error {
|
func (app *Application) SetProfile(filename string, password string) error {
|
||||||
profile, err := peer.LoadCwtchPeer(path.Join(app.directory, filename), password)
|
if app.Peer == nil {
|
||||||
if err != nil {
|
profile, err := peer.LoadCwtchPeer(path.Join(app.directory, filename), password)
|
||||||
return err
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
app.Peer = profile
|
||||||
|
return app.startPeer()
|
||||||
}
|
}
|
||||||
app.Peer = profile
|
return errors.New("profile is already loaded, to load a different profile you will need to restart the application")
|
||||||
return app.startPeer()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (app *Application) startPeer() error {
|
func (app *Application) startPeer() error {
|
||||||
|
|
Loading…
Reference in New Issue