Fix rebase
This commit is contained in:
+12
-12
@@ -1,36 +1,36 @@
|
|||||||
import {
|
import {
|
||||||
intersection,
|
intersection,
|
||||||
first,
|
first,
|
||||||
switcher,
|
|
||||||
throttleWithValue,
|
throttleWithValue,
|
||||||
clamp,
|
clamp,
|
||||||
last,
|
|
||||||
splitAt,
|
|
||||||
identity,
|
|
||||||
sortBy,
|
sortBy,
|
||||||
uniq,
|
|
||||||
shuffle,
|
shuffle,
|
||||||
pushToMapKey,
|
pushToMapKey,
|
||||||
now,
|
|
||||||
assoc,
|
|
||||||
ctx,
|
ctx,
|
||||||
sample,
|
always,
|
||||||
|
inc,
|
||||||
|
add,
|
||||||
|
ago,
|
||||||
|
take,
|
||||||
|
chunks,
|
||||||
|
MINUTE,
|
||||||
|
HOUR,
|
||||||
|
DAY,
|
||||||
|
WEEK,
|
||||||
} from "@welshman/lib"
|
} from "@welshman/lib"
|
||||||
import {
|
import {
|
||||||
Tags,
|
|
||||||
getFilterId,
|
getFilterId,
|
||||||
unionFilters,
|
|
||||||
isShareableRelayUrl,
|
isShareableRelayUrl,
|
||||||
isContextAddress,
|
|
||||||
PROFILE,
|
PROFILE,
|
||||||
RELAYS,
|
RELAYS,
|
||||||
INBOX_RELAYS,
|
INBOX_RELAYS,
|
||||||
FOLLOWS,
|
FOLLOWS,
|
||||||
LOCAL_RELAY_URL,
|
LOCAL_RELAY_URL,
|
||||||
WRAP,
|
WRAP,
|
||||||
|
getAncestorTags,
|
||||||
|
getPubkeyTagValues
|
||||||
} from "@welshman/util"
|
} from "@welshman/util"
|
||||||
import type {TrustedEvent, Filter} from "@welshman/util"
|
import type {TrustedEvent, Filter} from "@welshman/util"
|
||||||
import {ConnectionStatus, AuthStatus} from "@welshman/net"
|
|
||||||
import type {RelaysAndFilters} from "@welshman/net"
|
import type {RelaysAndFilters} from "@welshman/net"
|
||||||
import {pubkey} from "./session"
|
import {pubkey} from "./session"
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -63,9 +63,6 @@ export class Socket {
|
|||||||
}
|
}
|
||||||
|
|
||||||
close = async () => {
|
close = async () => {
|
||||||
if (this.cxn.url === 'wss://filter.nostr.wine/') {
|
|
||||||
console.trace('closing')
|
|
||||||
}
|
|
||||||
this.worker.pause()
|
this.worker.pause()
|
||||||
this.ws?.close()
|
this.ws?.close()
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export class Address {
|
|||||||
let type
|
let type
|
||||||
let data = {} as any
|
let data = {} as any
|
||||||
try {
|
try {
|
||||||
;({type, data} = nip19.decode(naddr) as {
|
({type, data} = nip19.decode(naddr) as {
|
||||||
type: "naddr"
|
type: "naddr"
|
||||||
data: any
|
data: any
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -116,8 +116,6 @@ export class Tags extends (Fluent<Tag> as OmitStatics<typeof Fluent<Tag>, "from"
|
|||||||
return parents.get("e") || parents.get("a")
|
return parents.get("e") || parents.get("a")
|
||||||
}
|
}
|
||||||
|
|
||||||
context = () => this.whereKey("a").filter(t => t.isContext())
|
|
||||||
|
|
||||||
asObject = () => {
|
asObject = () => {
|
||||||
const result: Record<string, string> = {}
|
const result: Record<string, string> = {}
|
||||||
|
|
||||||
@@ -146,14 +144,6 @@ export class Tags extends (Fluent<Tag> as OmitStatics<typeof Fluent<Tag>, "from"
|
|||||||
|
|
||||||
setTag = (k: string, ...args: string[]) => this.rejectByKey([k]).addTag(k, ...args)
|
setTag = (k: string, ...args: string[]) => this.rejectByKey([k]).addTag(k, ...args)
|
||||||
|
|
||||||
// Context
|
|
||||||
|
|
||||||
addContext = (addresses: string[]) => this.concat(addresses.map(a => Tag.from(["a", a])))
|
|
||||||
|
|
||||||
removeContext = () => this.reject(t => t.isContext())
|
|
||||||
|
|
||||||
setContext = (addresses: string[]) => this.removeContext().addContext(addresses)
|
|
||||||
|
|
||||||
// Images
|
// Images
|
||||||
|
|
||||||
addImages = (imeta: Tags[]) =>
|
addImages = (imeta: Tags[]) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user