improve diff filters
fix tests expander/compressor filter mangler
This commit is contained in:
@ -1,13 +1,13 @@
|
||||
import { RawEvent } from "System";
|
||||
import { NostrEvent } from "System";
|
||||
import { db } from "Db";
|
||||
import FeedCache from "./FeedCache";
|
||||
|
||||
class DMCache extends FeedCache<RawEvent> {
|
||||
class DMCache extends FeedCache<NostrEvent> {
|
||||
constructor() {
|
||||
super("DMCache", db.dms);
|
||||
}
|
||||
|
||||
key(of: RawEvent): string {
|
||||
key(of: NostrEvent): string {
|
||||
return of.id;
|
||||
}
|
||||
|
||||
@ -23,11 +23,11 @@ class DMCache extends FeedCache<RawEvent> {
|
||||
return ret;
|
||||
}
|
||||
|
||||
allDms(): Array<RawEvent> {
|
||||
allDms(): Array<NostrEvent> {
|
||||
return [...this.cache.values()];
|
||||
}
|
||||
|
||||
takeSnapshot(): Array<RawEvent> {
|
||||
takeSnapshot(): Array<NostrEvent> {
|
||||
return this.allDms();
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { HexKey, RawEvent, UserMetadata } from "System";
|
||||
import { HexKey, NostrEvent, UserMetadata } from "System";
|
||||
import { hexToBech32, unixNowMs } from "SnortUtils";
|
||||
import { DmCache } from "./DMCache";
|
||||
import { InteractionCache } from "./EventInteractionCache";
|
||||
@ -37,7 +37,7 @@ export interface MetadataCache extends UserMetadata {
|
||||
isNostrAddressValid: boolean;
|
||||
}
|
||||
|
||||
export function mapEventToProfile(ev: RawEvent) {
|
||||
export function mapEventToProfile(ev: NostrEvent) {
|
||||
try {
|
||||
const data: UserMetadata = JSON.parse(ev.content);
|
||||
return {
|
||||
|
Reference in New Issue
Block a user