diff --git a/app/app.go b/app/app.go index 08dfb4f..25f7592 100644 --- a/app/app.go +++ b/app/app.go @@ -41,6 +41,7 @@ type Application interface { CreateProfile(name string, password string, autostart bool) ImportProfile(exportedCwtchFile string, password string) (peer.CwtchPeer, error) + EnhancedImportProfile(exportedCwtchFile string, password string) string DeleteProfile(onion string, currentPassword string) AddPeerPlugin(onion string, pluginID plugins.PluginID) @@ -271,6 +272,14 @@ func (app *application) ImportProfile(exportedCwtchFile string, password string) return profile, err } +func (app *application) EnhancedImportProfile(exportedCwtchFile string, password string) string { + _, err := app.ImportProfile(exportedCwtchFile, password) + if err == nil { + return "" + } + return err.Error() +} + // LoadProfiles takes a password and attempts to load any profiles it can from storage with it and create Peers for them func (app *application) LoadProfiles(password string) { count := 0