Ignore:
Timestamp:
08/10/2026 02:43:16 PM (4 weeks ago)
Author:
Robin <roboburr@…>
Branches:
main
Children:
f0a33e1
Parents:
f549cf5
Message:

Alleen namen: het Nederlands van vandaag terug naar Engels

shaer-8ms zegt het al: Engelse namen, Nederlands commentaar waar dat helpt. Ik
ben er vandaag opnieuw van afgedreven en zet dat recht voordat er meer bovenop
komt -- gatesFor, messageItem, sentItem, conversationItems, ownHandle,
CONVERSATION_UNION, MESSAGE_COLUMNS, cursorOf, en de locals eromheen
(rows/more/oldest/direction/incoming/heads/self/size).

Geen gedrag, alleen namen, en daarom een eigen commit: die is na te lopen.
851/851 groen voor en na. Het commentaar blijft Nederlands.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/services/ActivityPubService.js

    rf549cf5 r3bbf73d  
    42104210// visibility 'direct'. Een publiek antwoord is geen gesprek en hoort niet als
    42114211// gezicht in de hemel.
    4212 const GESPREK_UNIE = `
     4212const CONVERSATION_UNION = `
    42134213  SELECT m.actor_uri AS other, COALESCE(m.published, m.created_at) AS stamp,
    4214          'in' AS richting, m.object_uri AS ref
     4214         'in' AS direction, m.object_uri AS ref
    42154215    FROM ap_mentions m
    42164216   WHERE m.slug = @slug AND m.actor_uri IS NOT NULL AND m.actor_uri <> ''
    42174217  UNION ALL
    42184218  SELECT j.value AS other, o.created_at AS stamp,
    4219          'uit' AS richting, o.id AS ref
     4219         'out' AS direction, o.id AS ref
    42204220    FROM ap_outbox o
    42214221    JOIN json_each(COALESCE(NULLIF(o.to_actors, ''), json_array(o.to_actor))) j
     
    42334233  try {
    42344234    return db.prepare(`
    4235       SELECT other, stamp, richting, ref FROM (
     4235      SELECT other, stamp, direction, ref FROM (
    42364236        SELECT *, ROW_NUMBER() OVER (PARTITION BY other ORDER BY stamp DESC, ref DESC) AS rn
    4237           FROM (${GESPREK_UNIE})
     4237          FROM (${CONVERSATION_UNION})
    42384238      ) WHERE rn = 1
    42394239      ORDER BY stamp DESC, ref DESC`).all({ slug });
     
    42604260 * ontbreekt alleen iets in het midden.
    42614261 */
    4262 const cursorVan = (r) => (r ? `${r.stamp}|${r.ref}` : null);
     4262const cursorOf = (r) => (r ? `${r.stamp}|${r.ref}` : null);
    42634263
    42644264export function conversationHistory(slug, other, { before = null, limit = 60 } = {}) {
    42654265  try {
    42664266    const n = Math.min(Math.max(parseInt(limit, 10) || 60, 1), 200);
    4267     const knip = String(before || '').indexOf('|');
    4268     const bStamp = before && knip > 0 ? String(before).slice(0, knip) : null;
    4269     const bRef = before && knip > 0 ? String(before).slice(knip + 1) : null;
    4270     const rijen = db.prepare(`
    4271       SELECT other, stamp, richting, ref FROM (${GESPREK_UNIE})
     4267    const sep = String(before || '').indexOf('|');
     4268    const bStamp = before && sep > 0 ? String(before).slice(0, sep) : null;
     4269    const bRef = before && sep > 0 ? String(before).slice(sep + 1) : null;
     4270    const rows = db.prepare(`
     4271      SELECT other, stamp, direction, ref FROM (${CONVERSATION_UNION})
    42724272       WHERE other = @other
    42734273         AND (@bStamp IS NULL OR stamp < @bStamp OR (stamp = @bStamp AND ref < @bRef))
    42744274       ORDER BY stamp DESC, ref DESC LIMIT @n`).all({ slug, other, bStamp, bRef, n: n + 1 });
    4275     const meer = rijen.length > n;
    4276     const uit = meer ? rijen.slice(0, n) : rijen;
    4277     return { rijen: uit, meer, oudste: cursorVan(uit[uit.length - 1]) };
    4278   } catch { return { rijen: [], meer: false, oudste: null }; }
     4275    const more = rows.length > n;
     4276    const page = more ? rows.slice(0, n) : rows;
     4277    return { rows: page, more, oldest: cursorOf(page[page.length - 1]) };
     4278  } catch { return { rows: [], more: false, oldest: null }; }
    42794279}
    42804280
    42814281// De kolommen die een bericht tot kaart maken. Een constante, want de
    4282 // gesprekslezing haalt dezelfde rijen op: twee lijsten die uiteenlopen leveren
     4282// gesprekslezing haalt dezelfde rows op: twee lijsten die uiteenlopen leveren
    42834283// een kaart die op de ene plek een plaatje heeft en op de andere niet.
    4284 const BERICHT_KOLOMMEN = `
     4284const MESSAGE_COLUMNS = `
    42854285      m.object_uri, m.note_url, m.actor_uri, m.actor_name, m.actor_handle, m.actor_icon, m.actor_url,
    42864286      m.content, m.published, m.created_at, m.wave, m.help_request,
     
    42934293  try {
    42944294    const gaten = lijst.map(() => '?').join(',');
    4295     return db.prepare(`SELECT ${BERICHT_KOLOMMEN} FROM ap_mentions m
     4295    return db.prepare(`SELECT ${MESSAGE_COLUMNS} FROM ap_mentions m
    42964296                        WHERE m.slug = ? AND m.object_uri IN (${gaten})`).all(slug, ...lijst);
    42974297  } catch { return []; }
     
    43014301  try {
    43024302    return db.prepare(`
    4303       SELECT ${BERICHT_KOLOMMEN}
     4303      SELECT ${MESSAGE_COLUMNS}
    43044304      FROM ap_mentions m
    43054305      WHERE m.slug = ?
Note: See TracChangeset for help on using the changeset viewer.