refactor(MuteListPolicy): shorthand private constructor

This commit is contained in:
P. Reis 2024-05-10 14:34:48 -03:00
parent ebeec2ccba
commit 86518dbac5

View file

@ -3,10 +3,7 @@ import { NostrEvent, NostrRelayOK, NPolicy, NStore } from '@nostrify/nostrify';
import { getTagSet } from '@/tags.ts'; import { getTagSet } from '@/tags.ts';
export class MuteListPolicy implements NPolicy { export class MuteListPolicy implements NPolicy {
constructor(private pubkey: string, private store: NStore) { constructor(private pubkey: string, private store: NStore) {}
this.store = store;
this.pubkey = pubkey;
}
async call(event: NostrEvent): Promise<NostrRelayOK> { async call(event: NostrEvent): Promise<NostrRelayOK> {
const allowEvent = ['OK', event.id, true, ''] as NostrRelayOK; const allowEvent = ['OK', event.id, true, ''] as NostrRelayOK;