MCPcopy Create free account
hub / github.com/cameri/nostream / isVanished

Method isVanished

src/repositories/user-repository.ts:60–69  ·  view source on GitHub ↗

* Returns vanish state from users.is_vanished, or lazily hydrates a user row from events once * when no users row exists (single upsert; no duplicate inserts).

(pubkey: Pubkey, client: DatabaseClient = this.dbClient)

Source from the content-addressed store, hash-verified

58 * when no users row exists (single upsert; no duplicate inserts).
59 */
60 public async isVanished(pubkey: Pubkey, client: DatabaseClient = this.dbClient): Promise<boolean> {
61 const existing = await this.findByPubkey(pubkey, client)
62 if (existing) {
63 return existing.isVanished
64 }
65
66 const vanishedFromEvents = await this.eventRepository.hasActiveRequestToVanish(pubkey)
67 await this.upsertVanishState(pubkey, vanishedFromEvents, client)
68 return vanishedFromEvents
69 }
70
71 public setVanished(pubkey: Pubkey, vanished: boolean, client: DatabaseClient = this.dbClient): Promise<number> {
72 return this.upsertVanishState(pubkey, vanished, client)

Callers

nothing calls this directly

Calls 3

findByPubkeyMethod · 0.95
upsertVanishStateMethod · 0.95

Tested by

no test coverage detected