Support for Enhanced Import

This commit is contained in:
Sarah Jamie Lewis 2023-02-27 14:05:52 -08:00
parent 848d5971b6
commit aceb4adeb1
1 changed files with 9 additions and 0 deletions

View File

@ -41,6 +41,7 @@ type Application interface {
CreateProfile(name string, password string, autostart bool) CreateProfile(name string, password string, autostart bool)
ImportProfile(exportedCwtchFile string, password string) (peer.CwtchPeer, error) ImportProfile(exportedCwtchFile string, password string) (peer.CwtchPeer, error)
EnhancedImportProfile(exportedCwtchFile string, password string) string
DeleteProfile(onion string, currentPassword string) DeleteProfile(onion string, currentPassword string)
AddPeerPlugin(onion string, pluginID plugins.PluginID) AddPeerPlugin(onion string, pluginID plugins.PluginID)
@ -271,6 +272,14 @@ func (app *application) ImportProfile(exportedCwtchFile string, password string)
return profile, err 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 // 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) { func (app *application) LoadProfiles(password string) {
count := 0 count := 0