mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-15 11:24:26 +01:00
Add interfaces for Mastodon entity types, hide deactivated accounts
This commit is contained in:
@@ -3,28 +3,12 @@ import Debug from '@soapbox/stickynotes/debug';
|
||||
import DOMPurify from 'isomorphic-dompurify';
|
||||
import { unfurl } from 'unfurl.js';
|
||||
|
||||
import { PreviewCard } from '@/entities/PreviewCard.ts';
|
||||
import { Time } from '@/utils/time.ts';
|
||||
import { fetchWorker } from '@/workers/fetch.ts';
|
||||
|
||||
const debug = Debug('ditto:unfurl');
|
||||
|
||||
interface PreviewCard {
|
||||
url: string;
|
||||
title: string;
|
||||
description: string;
|
||||
type: 'link' | 'photo' | 'video' | 'rich';
|
||||
author_name: string;
|
||||
author_url: string;
|
||||
provider_name: string;
|
||||
provider_url: string;
|
||||
html: string;
|
||||
width: number;
|
||||
height: number;
|
||||
image: string | null;
|
||||
embed_url: string;
|
||||
blurhash: string | null;
|
||||
}
|
||||
|
||||
async function unfurlCard(url: string, signal: AbortSignal): Promise<PreviewCard | null> {
|
||||
debug(`Unfurling ${url}...`);
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user