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:
Harvey Tindall
2021-05-21 22:46:46 +01:00
parent 3bf722c5fe
commit a6447165b7
8 changed files with 229 additions and 175 deletions
+3 -3
View File
@@ -817,8 +817,8 @@ func (app *appContext) sendByID(email *Message, ID ...string) error {
return err
}
}
if address, ok := app.storage.emails[id]; ok {
err = app.email.send(email, address.(string))
if address, ok := app.storage.emails[id]; ok && address.Contact && emailEnabled {
err = app.email.send(email, address.Addr)
if err != nil {
return err
}
@@ -838,7 +838,7 @@ func (app *appContext) getAddressOrName(jfID string) string {
return "@" + tgChat.Username
}
if addr, ok := app.storage.emails[jfID]; ok {
return addr.(string)
return addr.Addr
}
return ""
}