only apply attachment limit to localized atts

This commit is contained in:
Ted Unangst 2023-06-10 23:23:11 -04:00
parent 3b036f4975
commit d63e338089
1 changed files with 6 additions and 4 deletions

View File

@ -871,15 +871,17 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk {
desc = name desc = name
} }
localize := false localize := false
if numatts > 4 { if at == "Document" || at == "Image" {
ilog.Printf("excessive attachment: %s", at)
} else if at == "Document" || at == "Image" || (preferorig && at == "Link") {
mt = strings.ToLower(mt) mt = strings.ToLower(mt)
dlog.Printf("attachment: %s %s", mt, u) dlog.Printf("attachment: %s %s", mt, u)
if mt == "text/plain" || mt == "application/pdf" || if mt == "text/plain" || mt == "application/pdf" ||
strings.HasPrefix(mt, "image") { strings.HasPrefix(mt, "image") {
if numatts > 4 {
ilog.Printf("excessive attachment: %s", at)
} else {
localize = true localize = true
} }
}
} else { } else {
ilog.Printf("unknown attachment: %s", at) ilog.Printf("unknown attachment: %s", at)
} }