add email notify enable/disable; remove (de)hyphening
hyphen/dehyphen conflicted with new migration for email contact preference, and it's been a while since this has been an issue so i've just commented it out for now.
This commit is contained in:
@@ -171,3 +171,28 @@ func (app *appContext) migrateEmailConfig() {
|
||||
}
|
||||
app.loadConfig()
|
||||
}
|
||||
|
||||
func (app *appContext) migrateEmailStorage() error {
|
||||
var emails map[string]interface{}
|
||||
err := loadJSON(app.storage.emails_path, &emails)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
newEmails := map[string]EmailAddress{}
|
||||
for jfID, addr := range emails {
|
||||
newEmails[jfID] = EmailAddress{
|
||||
Addr: addr.(string),
|
||||
Contact: true,
|
||||
}
|
||||
}
|
||||
err = storeJSON(app.storage.emails_path+".bak", emails)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = storeJSON(app.storage.emails_path, newEmails)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
app.info.Println("Migrated to new email format. A backup has also been made.")
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user