mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
refactor: remove zap split creation from instanceV1Controller endpoint
This commit is contained in:
parent
e8a90c90cb
commit
e4b2a1b5b5
1 changed files with 1 additions and 14 deletions
|
|
@ -5,7 +5,6 @@ import { Conf } from '@/config.ts';
|
||||||
import { Storages } from '@/storages.ts';
|
import { Storages } from '@/storages.ts';
|
||||||
import { getInstanceMetadata } from '@/utils/instance.ts';
|
import { getInstanceMetadata } from '@/utils/instance.ts';
|
||||||
import { DittoZapSplits, getZapSplits } from '@/utils/zap-split.ts';
|
import { DittoZapSplits, getZapSplits } from '@/utils/zap-split.ts';
|
||||||
import { createAdminEvent } from '@/utils/api.ts';
|
|
||||||
|
|
||||||
const version = `3.0.0 (compatible; Ditto ${denoJson.version})`;
|
const version = `3.0.0 (compatible; Ditto ${denoJson.version})`;
|
||||||
|
|
||||||
|
|
@ -14,19 +13,7 @@ const instanceV1Controller: AppController = async (c) => {
|
||||||
const meta = await getInstanceMetadata(await Storages.db(), c.req.raw.signal);
|
const meta = await getInstanceMetadata(await Storages.db(), c.req.raw.signal);
|
||||||
const store = c.get('store');
|
const store = c.get('store');
|
||||||
|
|
||||||
let zap_split: DittoZapSplits | undefined = await getZapSplits(store, Conf.pubkey);
|
const zap_split: DittoZapSplits | undefined = await getZapSplits(store, Conf.pubkey) ?? {};
|
||||||
if (!zap_split) {
|
|
||||||
const dittoPubkey = '781a1527055f74c1f70230f10384609b34548f8ab6a0a6caa74025827f9fdae5';
|
|
||||||
const dittoMsg = 'Official Ditto Account';
|
|
||||||
await createAdminEvent({
|
|
||||||
kind: 30078,
|
|
||||||
tags: [
|
|
||||||
['d', 'pub.ditto.zapSplits'],
|
|
||||||
['p', dittoPubkey, '5', dittoMsg],
|
|
||||||
],
|
|
||||||
}, c);
|
|
||||||
zap_split = { [dittoPubkey]: { amount: 5, message: dittoMsg } };
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Protocol to use for WebSocket URLs, depending on the protocol of the `LOCAL_DOMAIN`. */
|
/** Protocol to use for WebSocket URLs, depending on the protocol of the `LOCAL_DOMAIN`. */
|
||||||
const wsProtocol = protocol === 'http:' ? 'ws:' : 'wss:';
|
const wsProtocol = protocol === 'http:' ? 'ws:' : 'wss:';
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue