Changeset 731e431 in Klonkt for src/services/ActivityPubService.js
- Timestamp:
- 07/01/2026 07:48:48 AM (2 months ago)
- Branches:
- main
- Children:
- 0403187
- Parents:
- 55a73f0
- File:
-
- 1 edited
-
src/services/ActivityPubService.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
r55a73f0 r731e431 1679 1679 const o = (it && typeof it.object === 'object' && it.object) ? it.object : it; 1680 1680 if (!o || !o.id) continue; 1681 if (o.type && o.type !== 'Note' && o.type !== 'Article' ) continue; // skip boosts/other1681 if (o.type && o.type !== 'Note' && o.type !== 'Article' && o.type !== 'Question') continue; // skip boosts/other 1682 1682 if (o.inReplyTo) continue; // top-level only 1683 1683 const auth = actorUriOf(o.attributedTo); 1684 1684 if (auth && auth !== actorUri) continue; // their OWN posts only 1685 1685 const html = HtmlSanitizerService.sanitize(o.content || ''); 1686 const poll = parsePoll(o); // a Question (poll) → carry its options/counts on backfill too 1686 1687 try { 1687 1688 const r = tlStmts().ins.run(o.id, slug, actorUri, ai.name, ai.handle, ai.icon, ai.url, html, o.url || null, o.published || null, mediaFromNote(o), o.sensitive ? 1 : 0, o.summary || null); 1688 1689 if (r && r.changes > 0) added++; 1690 // Set poll_json if this is a poll and we don't already have it (COALESCE preserves a vote). 1691 if (poll) { try { db.prepare('UPDATE ap_timeline SET poll_json = COALESCE(poll_json, ?) WHERE id = ? AND slug = ?').run(JSON.stringify(poll), o.id, slug); } catch { /* ignore */ } } 1689 1692 } catch { /* ignore */ } 1690 1693 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)