forked from cwtch.im/cwtch
1
0
Fork 0

Merge branch 'clifix' of cwtch.im/cwtch into master

This commit is contained in:
Dan Ballard 2018-08-05 17:23:19 +00:00 committed by Gogs
commit f217533044
1 changed files with 8 additions and 5 deletions

View File

@ -70,12 +70,15 @@ func (app *Application) startTor(torPath string) error {
// SetProfile loads an existing profile from the given filename.
func (app *Application) SetProfile(filename string, password string) error {
if app.Peer == nil {
profile, err := peer.LoadCwtchPeer(path.Join(app.directory, filename), password)
if err != nil {
return err
}
app.Peer = profile
return app.startPeer()
}
return errors.New("profile is already loaded, to load a different profile you will need to restart the application")
}
func (app *Application) startPeer() error {