webmail: fix displaying a message in separate window if there was no known viewmode (text or html or html with externals)

we were sending a zero value for ViewMode, which the frontend js rejected
during parsing.

noticed during testing.
This commit is contained in:
Mechiel Lukkien
2024-10-04 16:37:32 +02:00
parent 32b549b260
commit edb6e8d15c
2 changed files with 5 additions and 1 deletions

View File

@ -181,6 +181,8 @@ func formatFirstLine(r io.Reader) (string, error) {
}
func parsedMessage(log mlog.Log, m store.Message, state *msgState, full, msgitem bool) (pm ParsedMessage, rerr error) {
pm.ViewMode = store.ModeText // Valid default, in case this makes it to frontend.
if full || msgitem {
if !state.ensurePart(m, true) {
return pm, state.err