From 4451aafadcd27049b829c28382cdcdf3d9ba885b Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Fri, 21 Mar 2025 16:56:24 -0300 Subject: [PATCH 1/2] fix: index k tag even if the value is not a number and count is less than 3 --- packages/ditto/storages/DittoPgStore.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ditto/storages/DittoPgStore.ts b/packages/ditto/storages/DittoPgStore.ts index 1c85b07c..e8a969be 100644 --- a/packages/ditto/storages/DittoPgStore.ts +++ b/packages/ditto/storages/DittoPgStore.ts @@ -85,7 +85,7 @@ export class DittoPgStore extends NPostgres { 'a': ({ count }) => count < 15, 'd': ({ event, count }) => count === 0 && NKinds.parameterizedReplaceable(event.kind), 'e': DittoPgStore.eTagCondition, - 'k': ({ count, value }) => count === 0 && Number.isInteger(Number(value)), + 'k': ({ count }) => count < 3, 'L': ({ event, count }) => event.kind === 1985 || count === 0, 'l': ({ event, count }) => event.kind === 1985 || count === 0, 'n': ({ count, value }) => count < 50 && value.length < 50, From 06c9c8d898f0f68452c7afaf4d948ebf6bc84dd5 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 23 Mar 2025 12:11:39 -0500 Subject: [PATCH 2/2] Fix name grant notification not being rendered --- packages/ditto/views/mastodon/notifications.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/ditto/views/mastodon/notifications.ts b/packages/ditto/views/mastodon/notifications.ts index 7f71c1ea..16d1b52e 100644 --- a/packages/ditto/views/mastodon/notifications.ts +++ b/packages/ditto/views/mastodon/notifications.ts @@ -98,14 +98,14 @@ async function renderReaction(store: NStore, event: DittoEvent, opts: RenderNoti }; } -async function renderNameGrant(event: DittoEvent) { +function renderNameGrant(event: DittoEvent) { const r = event.tags.find(([name]) => name === 'r')?.[1]; const d = event.tags.find(([name]) => name === 'd')?.[1]; const name = r ?? d; - if (name) return; + if (!name) return; - const account = event.author ? await renderAccount(event.author) : await accountFromPubkey(event.pubkey); + const account = event.author ? renderAccount(event.author) : accountFromPubkey(event.pubkey); return { id: notificationId(event),