feat(tui): drop whitelist toggles from account form (managed via whitelist group)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+1
-14
@@ -24,7 +24,7 @@ type Fields struct {
|
||||
SMTPHost, SMTPPort, SMTPSecurity string
|
||||
Username, Password string
|
||||
FromAddress string
|
||||
WhitelistIn, WhitelistOut, ProcessBacklog bool
|
||||
ProcessBacklog bool
|
||||
SubjectRegex string
|
||||
}
|
||||
|
||||
@@ -90,7 +90,6 @@ func (f Fields) ToAccount() (store.Account, bool) {
|
||||
IMAPHost: f.IMAPHost, IMAPPort: ip, IMAPSecurity: f.IMAPSecurity,
|
||||
AuthType: "password", Username: f.Username, Password: f.Password,
|
||||
FromAddress: f.FromAddress,
|
||||
WhitelistInEnabled: f.WhitelistIn, WhitelistOutEnabled: f.WhitelistOut,
|
||||
SubjectRegex: f.SubjectRegex, ProcessBacklog: f.ProcessBacklog,
|
||||
}
|
||||
if f.Mode == "RW" {
|
||||
@@ -116,8 +115,6 @@ func FieldsFromAccount(a store.Account) Fields {
|
||||
SMTPHost: a.SMTPHost, SMTPPort: itoaPort(a.SMTPPort), SMTPSecurity: a.SMTPSecurity,
|
||||
Username: a.Username,
|
||||
FromAddress: a.FromAddress,
|
||||
WhitelistIn: a.WhitelistInEnabled,
|
||||
WhitelistOut: a.WhitelistOutEnabled,
|
||||
ProcessBacklog: a.ProcessBacklog,
|
||||
SubjectRegex: a.SubjectRegex,
|
||||
}
|
||||
@@ -144,8 +141,6 @@ var fieldDefs = []fieldDef{
|
||||
{key: "username", label: "Username"},
|
||||
{key: "from_address", label: "From address (optional)"},
|
||||
{key: "password", label: "Password", password: true},
|
||||
{key: "whitelist_in", label: "Whitelist inbound (y/n)", isBool: true},
|
||||
{key: "whitelist_out", label: "Whitelist outbound (y/n)", isBool: true},
|
||||
{key: "process_backlog", label: "Process backlog (y/n)", isBool: true},
|
||||
{key: "subject_regex", label: "Subject regex (optional)"},
|
||||
}
|
||||
@@ -189,10 +184,6 @@ func fieldValue(f Fields, key string) string {
|
||||
return f.FromAddress
|
||||
case "password":
|
||||
return f.Password
|
||||
case "whitelist_in":
|
||||
return boolStr(f.WhitelistIn)
|
||||
case "whitelist_out":
|
||||
return boolStr(f.WhitelistOut)
|
||||
case "process_backlog":
|
||||
return boolStr(f.ProcessBacklog)
|
||||
case "subject_regex":
|
||||
@@ -276,10 +267,6 @@ func (m AccountForm) collect() Fields {
|
||||
f.FromAddress = v
|
||||
case "password":
|
||||
f.Password = m.inputs[i].Value() // do not trim a password
|
||||
case "whitelist_in":
|
||||
f.WhitelistIn = parseBool(v)
|
||||
case "whitelist_out":
|
||||
f.WhitelistOut = parseBool(v)
|
||||
case "process_backlog":
|
||||
f.ProcessBacklog = parseBool(v)
|
||||
case "subject_regex":
|
||||
|
||||
Reference in New Issue
Block a user