mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-19 13:24:23 +01:00
Don't let your memes be dreams
This commit is contained in:
@@ -2,7 +2,9 @@ import { Storages } from '@/storages.ts';
|
||||
import { hasTag } from '@/tags.ts';
|
||||
|
||||
async function renderRelationship(sourcePubkey: string, targetPubkey: string) {
|
||||
const events = await Storages.db.query([
|
||||
const db = await Storages.db();
|
||||
|
||||
const events = await db.query([
|
||||
{ kinds: [3], authors: [sourcePubkey], limit: 1 },
|
||||
{ kinds: [3], authors: [targetPubkey], limit: 1 },
|
||||
{ kinds: [10000], authors: [sourcePubkey], limit: 1 },
|
||||
|
||||
@@ -22,7 +22,7 @@ interface RenderStatusOpts {
|
||||
async function renderStatus(event: DittoEvent, opts: RenderStatusOpts): Promise<any> {
|
||||
const { viewerPubkey, depth = 1 } = opts;
|
||||
|
||||
if (depth > 2 || depth < 0) return null;
|
||||
if (depth > 2 || depth < 0) return;
|
||||
|
||||
const note = nip19.noteEncode(event.id);
|
||||
|
||||
@@ -40,7 +40,10 @@ async function renderStatus(event: DittoEvent, opts: RenderStatusOpts): Promise<
|
||||
),
|
||||
];
|
||||
|
||||
const mentionedProfiles = await Storages.optimizer.query(
|
||||
const db = await Storages.db();
|
||||
const optimizer = await Storages.optimizer();
|
||||
|
||||
const mentionedProfiles = await optimizer.query(
|
||||
[{ kinds: [0], authors: mentionedPubkeys, limit: mentionedPubkeys.length }],
|
||||
);
|
||||
|
||||
@@ -53,7 +56,7 @@ async function renderStatus(event: DittoEvent, opts: RenderStatusOpts): Promise<
|
||||
),
|
||||
firstUrl ? unfurlCardCached(firstUrl) : null,
|
||||
viewerPubkey
|
||||
? await Storages.db.query([
|
||||
? await db.query([
|
||||
{ kinds: [6], '#e': [event.id], authors: [viewerPubkey], limit: 1 },
|
||||
{ kinds: [7], '#e': [event.id], authors: [viewerPubkey], limit: 1 },
|
||||
{ kinds: [9734], '#e': [event.id], authors: [viewerPubkey], limit: 1 },
|
||||
|
||||
Reference in New Issue
Block a user