Streaming: temporarily remove UserStore (allow blocked posts through)
This commit is contained in:
parent
7efd5c1822
commit
5001567b00
|
@ -9,7 +9,6 @@ import { bech32ToPubkey } from '@/utils.ts';
|
||||||
import { renderReblog, renderStatus } from '@/views/mastodon/statuses.ts';
|
import { renderReblog, renderStatus } from '@/views/mastodon/statuses.ts';
|
||||||
import { hydrateEvents } from '@/storages/hydrate.ts';
|
import { hydrateEvents } from '@/storages/hydrate.ts';
|
||||||
import { Storages } from '@/storages.ts';
|
import { Storages } from '@/storages.ts';
|
||||||
import { UserStore } from '@/storages/UserStore.ts';
|
|
||||||
|
|
||||||
const debug = Debug('ditto:streaming');
|
const debug = Debug('ditto:streaming');
|
||||||
|
|
||||||
|
@ -68,17 +67,14 @@ const streamingController: AppController = (c) => {
|
||||||
const filter = await topicToFilter(stream, c.req.query(), pubkey);
|
const filter = await topicToFilter(stream, c.req.query(), pubkey);
|
||||||
if (!filter) return;
|
if (!filter) return;
|
||||||
|
|
||||||
const store = pubkey ? new UserStore(pubkey, Storages.admin) : Storages.admin;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for await (const msg of Storages.pubsub.req([filter], { signal: controller.signal })) {
|
for await (const msg of Storages.pubsub.req([filter], { signal: controller.signal })) {
|
||||||
if (msg[0] === 'EVENT') {
|
if (msg[0] === 'EVENT') {
|
||||||
const [event] = await store.query([{ ids: [msg[2].id] }]);
|
const event = msg[2];
|
||||||
if (!event) continue;
|
|
||||||
|
|
||||||
await hydrateEvents({
|
await hydrateEvents({
|
||||||
events: [event],
|
events: [event],
|
||||||
storage: store,
|
storage: Storages.admin,
|
||||||
signal: AbortSignal.timeout(1000),
|
signal: AbortSignal.timeout(1000),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue