Skip to content

Welshman Docs / @welshman/app / RoomLists

Class: RoomLists

Defined in: app/src/plugins/roomLists.ts:17

NIP-51 kind-10009 room lists (relays the user belongs to, and the rooms on them), keyed by pubkey. Loaded via the outbox model (the author's write relays), so it depends on the relay-list collection.

Extends

Constructors

Constructor

new RoomLists(app): RoomLists

Defined in: app/src/plugins/roomLists.ts:18

Parameters

app

IApp

Returns

RoomLists

Overrides

DerivedPlugin.constructor

Properties

all

all: Projection<RoomListReader[]>

Defined in: app/src/plugins/base.ts:208

Inherited from

DerivedPlugin.all


app

protected readonly app: IApp

Defined in: app/src/plugins/base.ts:216

Inherited from

DerivedPlugin.app


forceLoad()

forceLoad: (key, ...args) => Promise<Maybe<RoomListReader>>

Defined in: app/src/plugins/base.ts:211

Parameters

key

string

args

...any[]

Returns

Promise<Maybe<RoomListReader>>

Inherited from

DerivedPlugin.forceLoad


index

index: Projection<ItemsByKey<RoomListReader>>

Defined in: app/src/plugins/base.ts:207

Inherited from

DerivedPlugin.index


load()

load: (key, ...args) => Promise<Maybe<RoomListReader>>

Defined in: app/src/plugins/base.ts:210

Parameters

key

string

args

...any[]

Returns

Promise<Maybe<RoomListReader>>

Inherited from

DerivedPlugin.load


one()

one: (key?, ...args) => Readable<Maybe<RoomListReader>>

Defined in: app/src/plugins/base.ts:209

Parameters

key?

string

args?

...any[]

Returns

Readable<Maybe<RoomListReader>>

Inherited from

DerivedPlugin.one

Methods

addRelay()

addRelay(url): Promise<Command>

Defined in: app/src/plugins/roomLists.ts:54

Parameters

url

string

Returns

Promise<Command>


addRoom()

addRoom(roomId, url): Promise<Command>

Defined in: app/src/plugins/roomLists.ts:49

Parameters

roomId

string

url

string

Returns

Promise<Command>


fetch()

fetch(pubkey, relayHints): Promise<undefined | TrustedEvent>

Defined in: app/src/plugins/roomLists.ts:26

Parameters

pubkey

string

relayHints

string[] = []

Returns

Promise<undefined | TrustedEvent>

Overrides

DerivedPlugin.fetch


get()

get(key): undefined | RoomListReader

Defined in: app/src/plugins/base.ts:237

Parameters

key

string

Returns

undefined | RoomListReader

Inherited from

DerivedPlugin.get


migrateRelay()

migrateRelay(oldUrl, newUrl): Promise<Maybe<Command>>

Defined in: app/src/plugins/roomLists.ts:62

Parameters

oldUrl

string

newUrl

string

Returns

Promise<Maybe<Command>>


project()

project<U>(key, read): Projection<U>

Defined in: app/src/plugins/base.ts:239

Type Parameters

U

U

Parameters

key

string

read

(item) => U

Returns

Projection<U>

Inherited from

DerivedPlugin.project


pubkeysForUrl()

pubkeysForUrl(url): Projection<string[]>

Defined in: app/src/plugins/roomLists.ts:35

Parameters

url

string

Returns

Projection<string[]>


removeRelay()

removeRelay(url): Promise<Command>

Defined in: app/src/plugins/roomLists.ts:56

Parameters

url

string

Returns

Promise<Command>


removeRoom()

removeRoom(roomId, url?): Promise<Command>

Defined in: app/src/plugins/roomLists.ts:51

Parameters

roomId

string

url?

string

Returns

Promise<Command>


roomsForUrl()

roomsForUrl(pubkey, url): Projection<string[]>

Defined in: app/src/plugins/roomLists.ts:32

Parameters

pubkey

string

url

string

Returns

Projection<string[]>


setRelays()

setRelays(urls): Promise<Command>

Defined in: app/src/plugins/roomLists.ts:58

Parameters

urls

string[]

Returns

Promise<Command>


update()

update(fn): Promise<Command>

Defined in: app/src/plugins/roomLists.ts:40

Parameters

fn

(writer) => void

Returns

Promise<Command>


urls()

urls(pubkey): Projection<string[]>

Defined in: app/src/plugins/roomLists.ts:30

Parameters

pubkey

string

Returns

Projection<string[]>