Changeset fe97cc3 in Klonkt for src/config/database.js


Ignore:
Timestamp:
07/01/2026 10:13:40 PM (2 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
2abd3d2
Parents:
254939c
Message:

feat(fediverse): notification when mentioned in a non-reply post

An inbound Create whose Mention tag targets one of our actors — but which isn't a
reply to our content — was silently ignored. It's now stored and shown in the
fediverse notifications (@ icon, snippet, link to the original note). Only hrefs on
our own base count (a /ap/users/<slug> path on a remote host is someone else's actor).

  • src/config/database.js — ap_mentions table (per-site, UNIQUE(slug, object_uri)).
  • src/services/ActivityPubService.js — localMentionSlugs(tags, base) detection helper (own-base guard, slug must exist, deduped); the Create branch stores a mention per targeted site; getNotifications includes mentions.
  • src/views/pages/fedi-notifications.ejs — mention item (@ icon, content, view-original link).
  • src/services/i18n.js — notif.mentioned (nl/en/de).
  • test/inbound-mentions.test.js — detection guards + notification surfacing.
  • CHANGELOG(.nl/.de).md — "A mention is now a notification" under Added.

Closes prutfolio-src-xgg.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/config/database.js

    r254939c rfe97cc3  
    347347    );
    348348    CREATE INDEX IF NOT EXISTS idx_poll_votes_post ON poll_votes(post_id);
     349    CREATE TABLE IF NOT EXISTS ap_mentions (
     350      id INTEGER PRIMARY KEY AUTOINCREMENT,
     351      slug TEXT NOT NULL,           -- our mentioned site/actor
     352      object_uri TEXT NOT NULL,     -- the remote note that mentions us
     353      note_url TEXT,                -- its human URL (open/interact)
     354      actor_uri TEXT, actor_name TEXT, actor_handle TEXT, actor_icon TEXT, actor_url TEXT,
     355      content TEXT,                 -- sanitized HTML snippet of the mentioning note
     356      published TEXT,
     357      created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
     358      UNIQUE(slug, object_uri)
     359    );
     360    CREATE INDEX IF NOT EXISTS idx_ap_mentions_slug ON ap_mentions(slug, created_at);
    349361    CREATE TABLE IF NOT EXISTS ap_reports (
    350362      id INTEGER PRIMARY KEY AUTOINCREMENT,
Note: See TracChangeset for help on using the changeset viewer.