Changeset 914eb9f in Klonkt for src/config


Ignore:
Timestamp:
06/24/2026 03:19:11 PM (3 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
d988fa0
Parents:
0dba092
Message:

feat(fediverse-client): follow accounts + home timeline

Klonkt can now follow fediverse accounts (WebFinger -> signed Follow; Accept/Reject
handled) and shows their posts in a home timeline at /tijdlijn (owner-only).
New ap_following + ap_timeline tables; inbox stores top-level posts from followed
accounts + removes them on upstream Delete. Beheer link added.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/config/database.js

    r0dba092 r914eb9f  
    356356  `);
    357357  ensureColumn('ap_interactions', 'parent_uri', 'TEXT'); // nesting (existing DBs)
     358
     359  // Fediverse CLIENT: accounts WE follow (outbound) + the home timeline of their posts.
     360  db.exec(`
     361    CREATE TABLE IF NOT EXISTS ap_following (
     362      id INTEGER PRIMARY KEY AUTOINCREMENT,
     363      slug TEXT NOT NULL,            -- our site that follows
     364      actor_uri TEXT NOT NULL,       -- the followed account's actor id
     365      handle TEXT, name TEXT, icon TEXT, url TEXT,
     366      inbox TEXT,                    -- their inbox (for Create delivery / Undo)
     367      follow_id TEXT,                -- the Follow activity id we sent (Accept matching)
     368      status TEXT DEFAULT 'pending', -- pending | accepted
     369      created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
     370      UNIQUE(slug, actor_uri)
     371    );
     372    CREATE TABLE IF NOT EXISTS ap_timeline (
     373      id TEXT NOT NULL,              -- the remote note's AP id
     374      slug TEXT NOT NULL,            -- whose home timeline (our site)
     375      author_uri TEXT, author_name TEXT, author_handle TEXT, author_icon TEXT, author_url TEXT,
     376      content TEXT, url TEXT, published TEXT, media_json TEXT,
     377      created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
     378      UNIQUE(slug, id)
     379    );
     380    CREATE INDEX IF NOT EXISTS idx_ap_timeline_slug ON ap_timeline(slug, published);
     381  `);
    358382}
    359383
Note: See TracChangeset for help on using the changeset viewer.