mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 13:04:38 +03:00
webmail: when listing messages in backend to send to frontend, don't error out when there's a large plain text part
by not trying to parse the full message for the MessageItem, but only reading headers when needed. before previous commit, we wouldn't try reading such messages in full either.
This commit is contained in:
@ -650,7 +650,7 @@ func handle(apiHandler http.Handler, isForwarded bool, accountPath string, w htt
|
||||
state := msgState{acc: acc, m: m, msgr: msgr, part: &p}
|
||||
// note: state is cleared by cleanup
|
||||
|
||||
pm, err := parsedMessage(log, m, &state, true, true)
|
||||
pm, err := parsedMessage(log, m, &state, true, true, true)
|
||||
xcheckf(ctx, err, "getting parsed message")
|
||||
if t[1] == "msgtext" && len(pm.Texts) == 0 || t[1] != "msgtext" && !pm.HasHTML {
|
||||
http.Error(w, "400 - bad request - no such part", http.StatusBadRequest)
|
||||
@ -682,7 +682,7 @@ func handle(apiHandler http.Handler, isForwarded bool, accountPath string, w htt
|
||||
state := msgState{acc: acc, m: m, msgr: msgr, part: &p}
|
||||
// note: state is cleared by cleanup
|
||||
|
||||
pm, err := parsedMessage(log, m, &state, true, true)
|
||||
pm, err := parsedMessage(log, m, &state, true, true, true)
|
||||
xcheckf(ctx, err, "parsing parsedmessage")
|
||||
pmjson, err := json.Marshal(pm)
|
||||
xcheckf(ctx, err, "marshal parsedmessage")
|
||||
@ -715,7 +715,7 @@ func handle(apiHandler http.Handler, isForwarded bool, accountPath string, w htt
|
||||
state := msgState{acc: acc, m: m, msgr: msgr, part: &p}
|
||||
// note: state is cleared by cleanup
|
||||
|
||||
pm, err := parsedMessage(log, m, &state, true, true)
|
||||
pm, err := parsedMessage(log, m, &state, true, true, true)
|
||||
xcheckf(ctx, err, "parsing parsedmessage")
|
||||
|
||||
if len(pm.Texts) == 0 {
|
||||
|
Reference in New Issue
Block a user