diff --git a/src/lib/duplicationHandling.js b/src/lib/duplicationHandling.js index 0df8c8f..68e3e42 100644 --- a/src/lib/duplicationHandling.js +++ b/src/lib/duplicationHandling.js @@ -23,6 +23,9 @@ export default class DuplicationHandling { console.log(`Event ${event.id} already flagged. Skipping`); return; } + console.log( + `Event ${event.id} already seen but not flagged. Processing.` + ); // Event was already seen and not flagged but now the user requests manual verification onlySlack = true; diff --git a/src/lib/nostr.js b/src/lib/nostr.js index 7f2c72a..77b8215 100644 --- a/src/lib/nostr.js +++ b/src/lib/nostr.js @@ -151,11 +151,13 @@ export default class Nostr { static async isAlreadyFlagged(id) { await connectedPromise; const user = await userPromise; + console.log("Checking if event is already flagged", id); const event = await ndk.fetchEvent({ "#e": [id], kinds: [REPORT_KIND], - authors: [user.pubkey], + authors: [user.hexpubkey], }); + console.log(`Event ${id} already flagged:`, !!event); return !!event; } diff --git a/src/lib/slack.js b/src/lib/slack.js index 4115716..bc442e8 100644 --- a/src/lib/slack.js +++ b/src/lib/slack.js @@ -1,5 +1,6 @@ import { WebClient } from "@slack/web-api"; import OPENAI_CATEGORIES from "./openAICategories.js"; +import Nostr from "./nostr.js"; if (!process.env.SLACK_TOKEN) { throw new Error("SLACK_TOKEN environment variable is required");