Changeset 737ea05 in Klonkt for src/config/database.js


Ignore:
Timestamp:
07/01/2026 07:26:13 PM (2 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
9e1b1bb
Parents:
1c2dcba
Message:

feat(fediverse): receive reports (inbound Flag) → owner's notifications

Completes the Klonkt↔Klonkt report loop: a Flag delivered to a Klonkt inbox was
previously ignored. It's now signature-enforced, stored, and surfaced to the site
owner (who moderates their own instance) in the fediverse notifications.

  • src/config/database.js — ap_reports table (per-site incoming reports).
  • src/services/ActivityPubService.js — handleInbox handles inbound Flag (resolves which local site it targets from the reported object URIs, stores reporter + reason); Flag added to the signature-GATED list; getNotifications includes reports.
  • src/views/pages/fedi-notifications.ejs — a report item (flag icon, reason).
  • src/services/i18n.js — notif.reported (nl/en/de).
  • CHANGELOG(.nl/.de).md — note that reports about your site show in notifications.

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/config/database.js

    r1c2dcba r737ea05  
    347347    );
    348348    CREATE INDEX IF NOT EXISTS idx_poll_votes_post ON poll_votes(post_id);
     349    CREATE TABLE IF NOT EXISTS ap_reports (
     350      id INTEGER PRIMARY KEY AUTOINCREMENT,
     351      slug TEXT NOT NULL,           -- our site the report is about (its owner moderates)
     352      actor_uri TEXT,               -- the reporter's actor URI
     353      actor_name TEXT, actor_handle TEXT, actor_icon TEXT,
     354      content TEXT,                 -- the reason (plain text)
     355      objects TEXT,                 -- JSON array of reported object URIs (our actor + statuses)
     356      seen INTEGER DEFAULT 0,
     357      created_at DATETIME DEFAULT CURRENT_TIMESTAMP
     358    );
     359    CREATE INDEX IF NOT EXISTS idx_ap_reports_slug ON ap_reports(slug, created_at);
    349360  `);
    350361  // "Feature" a followed account: its posts show in the local Cirkel.
Note: See TracChangeset for help on using the changeset viewer.