File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/electron-main/api/endpoints-builders/database Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ import {IPC_MAIN_API_DB_INDEXER_REQUEST$, IPC_MAIN_API_NOTIFICATION$} from "src/
1717import { IPC_MAIN_API_DB_INDEXER_REQUEST_ACTIONS , IPC_MAIN_API_NOTIFICATION_ACTIONS } from "src/shared/api/main-process/actions" ;
1818import { IpcMainApiEndpoints } from "src/shared/api/main-process" ;
1919import { narrowIndexActionPayload } from "./indexing/service" ;
20+ import { parseProtonRestModel , readMailBody } from "src/shared/util/entity" ;
2021import { patchMetadata } from "src/electron-main/database/util" ;
2122import { prepareFoldersView } from "./folders-view" ;
22- import { readMailBody } from "src/shared/util/entity" ;
2323import { validateEntity } from "src/electron-main/database/validation" ;
2424
2525const _logger = curryFunctionMembers ( electronLog , __filename ) ;
@@ -267,7 +267,11 @@ export async function buildEndpoints(ctx: Context): Promise<Pick<IpcMainApiEndpo
267267 ...omit ( mail , [ "body" ] ) ,
268268 // TODO test "dbGetAccountMail" setting "mail.body" through the "sanitizeHtml" call
269269 body : sanitizeHtml (
270- readMailBody ( mail ) ,
270+ Object
271+ . entries ( parseProtonRestModel ( mail ) . ParsedHeaders )
272+ . some ( ( [ name , value ] ) => name . toLowerCase ( ) === "content-type" && value === "text/plain" )
273+ ? readMailBody ( mail ) . replace ( / [ \n \r ] / g, "<br>" )
274+ : readMailBody ( mail )
271275 ) ,
272276 } ;
273277 } ,
You can’t perform that action at this time.
0 commit comments