Initial Prototype of Event Hooks #488

Merged
sarah merged 13 commits from eventhooks into master 2023-02-28 18:59:50 +00:00
1 changed files with 9 additions and 0 deletions
Showing only changes of commit aceb4adeb1 - Show all commits

View File

@ -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