add the ditto.external field to statuses and accounts

This commit is contained in:
Siddharth Singh 2024-06-24 02:03:31 +05:30
parent 60b4ea4643
commit f19afa449a
No known key found for this signature in database
4 changed files with 8 additions and 0 deletions

View file

@ -40,6 +40,7 @@ export interface MastodonAccount {
username: string; username: string;
ditto: { ditto: {
accepts_zaps: boolean; accepts_zaps: boolean;
external?: URL;
}; };
pleroma: { pleroma: {
deactivated: boolean; deactivated: boolean;

View file

@ -39,4 +39,7 @@ export interface MastodonStatus {
expires_at?: string; expires_at?: string;
quotes_count: number; quotes_count: number;
}; };
ditto: {
external?: URL;
};
} }

View file

@ -82,6 +82,7 @@ async function renderAccount(
username: parsed05?.nickname || npub.substring(0, 8), username: parsed05?.nickname || npub.substring(0, 8),
ditto: { ditto: {
accepts_zaps: Boolean(getLnurl({ lud06, lud16 })), accepts_zaps: Boolean(getLnurl({ lud06, lud16 })),
external: Conf.externalDomain === Conf.localDomain ? undefined : Conf.external(npub),
}, },
pleroma: { pleroma: {
deactivated: names.has('disabled'), deactivated: names.has('disabled'),

View file

@ -124,6 +124,9 @@ async function renderStatus(event: DittoEvent, opts: RenderStatusOpts): Promise<
uri: Conf.local(`/${note}`), uri: Conf.local(`/${note}`),
url: Conf.local(`/${note}`), url: Conf.local(`/${note}`),
zapped: Boolean(zapEvent), zapped: Boolean(zapEvent),
ditto: {
external: Conf.externalDomain === Conf.localDomain ? undefined : Conf.external(note),
},
pleroma: { pleroma: {
emoji_reactions: reactions, emoji_reactions: reactions,
expires_at: !isNaN(expiresAt.getTime()) ? expiresAt.toISOString() : undefined, expires_at: !isNaN(expiresAt.getTime()) ? expiresAt.toISOString() : undefined,