From 038e6f6fed1fbc47103065e4b4f48d01d71a5606 Mon Sep 17 00:00:00 2001 From: mic Date: Sun, 22 Mar 2026 15:30:40 +0100 Subject: [PATCH] hasfield gets now a record object. see #675 --- js/mzta-storage.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/js/mzta-storage.js b/js/mzta-storage.js index 989bb70a..e6fd8fa4 100644 --- a/js/mzta-storage.js +++ b/js/mzta-storage.js @@ -55,15 +55,14 @@ export class taStorage { } /** - * Check if a record exists and contains the specified field. - * @param {string} messageId - The Message-ID header string. + * Check if a record contains the specified field. + * @param {object|null} record - The record object (from getRecord). * @param {string} field - The field name to check ("spam", "summary", or "translation"). - * @returns {Promise} True if the record exists and the field is present. + * @returns {boolean} True if the record exists and the field is present. */ - async hasField(messageId, field) { + hasField(record, field) { try { - let record = await this.getRecord(messageId); - return record !== null && field in record; + return record !== null && record !== undefined && field in record; } catch (e) { this.taLog.error('hasField error: ' + e); return false;