From 729dcf17ef66c8d473612c128182db2cb6ad4340 Mon Sep 17 00:00:00 2001 From: ClaraCrazy Date: Sat, 28 Sep 2024 05:21:51 +0200 Subject: [PATCH] slight cleanup, thx qt --- application/imap-service.js | 5 ++--- infrastructure/web/routes/inbox.js | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/application/imap-service.js b/application/imap-service.js index 1be5f60..f23b19b 100644 --- a/application/imap-service.js +++ b/application/imap-service.js @@ -279,9 +279,8 @@ class ImapService extends EventEmitter { const messages = await this.connection.search(searchCriteria, fetchOptions) if (messages.length === 0) { - return("womp womp") - } - if (!raw) { + return false + } else if (!raw) { const fullBody = await _.find(messages[0].parts, {which: ''}) return simpleParser(fullBody.body) } else { diff --git a/infrastructure/web/routes/inbox.js b/infrastructure/web/routes/inbox.js index 6eb48b1..f6a58d5 100644 --- a/infrastructure/web/routes/inbox.js +++ b/infrastructure/web/routes/inbox.js @@ -32,7 +32,7 @@ router.get( req.params.address, req.params.uid ) - if (mail && mail != "womp womp") { + if (mail) { // Emails are immutable, cache if found res.set('Cache-Control', 'private, max-age=600') res.render('mail', { @@ -107,7 +107,7 @@ router.get( true ) mail = mail.replace(/(?:\r\n|\r|\n)/g, '
') - if (mail && mail != "womp womp") { + if (mail) { // Emails are immutable, cache if found res.set('Cache-Control', 'private, max-age=600') res.render('raw', {