forked from coracle/flotilla
Drop support for legacy messages
This commit is contained in:
@@ -7,7 +7,7 @@ android {
|
|||||||
applicationId "social.flotilla"
|
applicationId "social.flotilla"
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
minSdkVersion rootProject.ext.minSdkVersion
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||||
versionCode 3
|
versionCode 4
|
||||||
versionName "0.2.4"
|
versionName "0.2.4"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
aaptOptions {
|
aaptOptions {
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ android {
|
|||||||
|
|
||||||
apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
|
apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
|
||||||
dependencies {
|
dependencies {
|
||||||
|
implementation project(':capacitor-app')
|
||||||
implementation project(':nostr-signer-capacitor-plugin')
|
implementation project(':nostr-signer-capacitor-plugin')
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,5 +2,8 @@
|
|||||||
include ':capacitor-android'
|
include ':capacitor-android'
|
||||||
project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')
|
project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')
|
||||||
|
|
||||||
|
include ':capacitor-app'
|
||||||
|
project(':capacitor-app').projectDir = new File('../node_modules/@capacitor/app/android')
|
||||||
|
|
||||||
include ':nostr-signer-capacitor-plugin'
|
include ':nostr-signer-capacitor-plugin'
|
||||||
project(':nostr-signer-capacitor-plugin').projectDir = new File('../node_modules/nostr-signer-capacitor-plugin/android')
|
project(':nostr-signer-capacitor-plugin').projectDir = new File('../node_modules/nostr-signer-capacitor-plugin/android')
|
||||||
|
|||||||
Generated
+26
-53
@@ -8,9 +8,10 @@
|
|||||||
"name": "flotilla",
|
"name": "flotilla",
|
||||||
"version": "0.2.4",
|
"version": "0.2.4",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@capacitor/android": "^6.1.2",
|
"@capacitor/android": "^7.0.1",
|
||||||
"@capacitor/cli": "^6.1.2",
|
"@capacitor/app": "^7.0.0",
|
||||||
"@capacitor/core": "^6.1.2",
|
"@capacitor/cli": "^6.2.0",
|
||||||
|
"@capacitor/core": "^7.0.1",
|
||||||
"@noble/curves": "^1.5.0",
|
"@noble/curves": "^1.5.0",
|
||||||
"@noble/hashes": "^1.4.0",
|
"@noble/hashes": "^1.4.0",
|
||||||
"@poppanator/sveltekit-svg": "^4.2.1",
|
"@poppanator/sveltekit-svg": "^4.2.1",
|
||||||
@@ -1794,12 +1795,21 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@capacitor/android": {
|
"node_modules/@capacitor/android": {
|
||||||
"version": "6.1.2",
|
"version": "7.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@capacitor/android/-/android-6.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/@capacitor/android/-/android-7.0.1.tgz",
|
||||||
"integrity": "sha512-Yh0gQDY1bgRrL25J6ecIlvvs2kF8iNSwIPXjyw6Yz9mnwYxBazF5KZbjpKtGPnJgicJhFkYGsqOkEtxrve0EoQ==",
|
"integrity": "sha512-jukJJHfkcyEBOkFBJRD3EwXMIIQo7lSv0ExPWgsIliPdGXLAj6ElvK2JaYEzec3vKyLc4RTNFVv0PMEU0vnImg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@capacitor/core": "^6.1.0"
|
"@capacitor/core": "^7.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@capacitor/app": {
|
||||||
|
"version": "7.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@capacitor/app/-/app-7.0.0.tgz",
|
||||||
|
"integrity": "sha512-/UFwfPFsw/Jen6vjrV0lfTBOQWSaDDdmrYXKpYg4Xn8hwj0xrrRPXxC43j7VmPoj9AFMVPA+hx94ygqjChPASQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"peerDependencies": {
|
||||||
|
"@capacitor/core": ">=7.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@capacitor/assets": {
|
"node_modules/@capacitor/assets": {
|
||||||
@@ -2105,14 +2115,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@capacitor/cli": {
|
"node_modules/@capacitor/cli": {
|
||||||
"version": "6.1.2",
|
"version": "6.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-6.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-6.2.0.tgz",
|
||||||
"integrity": "sha512-HKCNGE0RP8U7aiEF2vg5wTivJROS8BVfu8a3yYJb1mRQvzv+czpmtHNsTWS/WukvwoxUjyjRmsNQSAACHfMTmQ==",
|
"integrity": "sha512-EWcXG39mZh35zrHhOqzN1ILeSyMRyEqWVtQDXqMGjCXYRH6b6p5TvyvLDN8ZNy26tbhI3i79gfrgirt+mNwuuw==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ionic/cli-framework-output": "^2.2.5",
|
"@ionic/cli-framework-output": "^2.2.5",
|
||||||
"@ionic/utils-fs": "^3.1.6",
|
"@ionic/utils-fs": "^3.1.6",
|
||||||
"@ionic/utils-process": "^2.1.11",
|
|
||||||
"@ionic/utils-subprocess": "2.1.11",
|
"@ionic/utils-subprocess": "2.1.11",
|
||||||
"@ionic/utils-terminal": "^2.3.3",
|
"@ionic/utils-terminal": "^2.3.3",
|
||||||
"commander": "^9.3.0",
|
"commander": "^9.3.0",
|
||||||
@@ -2216,9 +2225,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@capacitor/core": {
|
"node_modules/@capacitor/core": {
|
||||||
"version": "6.1.2",
|
"version": "7.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@capacitor/core/-/core-6.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/@capacitor/core/-/core-7.0.1.tgz",
|
||||||
"integrity": "sha512-xFy1/4qLFLp5WCIzIhtwUuVNNoz36+V7/BzHmLqgVJcvotc4MMjswW/TshnPQaLLujEOaLkA4h8ZJ0uoK3ImGg==",
|
"integrity": "sha512-1Ob9bvA/p8g8aNwK6VesxEekGXowLVf6APjkW4LRnr05H+7z/bke+Q5pn9zqh/GgTbIxAQ/rwZrAZvvxkdm1UA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tslib": "^2.1.0"
|
"tslib": "^2.1.0"
|
||||||
@@ -2774,42 +2783,6 @@
|
|||||||
"node": ">=16.0.0"
|
"node": ">=16.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@ionic/utils-object": {
|
|
||||||
"version": "2.1.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@ionic/utils-object/-/utils-object-2.1.6.tgz",
|
|
||||||
"integrity": "sha512-vCl7sl6JjBHFw99CuAqHljYJpcE88YaH2ZW4ELiC/Zwxl5tiwn4kbdP/gxi2OT3MQb1vOtgAmSNRtusvgxI8ww==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"debug": "^4.0.0",
|
|
||||||
"tslib": "^2.0.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=16.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@ionic/utils-process": {
|
|
||||||
"version": "2.1.12",
|
|
||||||
"resolved": "https://registry.npmjs.org/@ionic/utils-process/-/utils-process-2.1.12.tgz",
|
|
||||||
"integrity": "sha512-Jqkgyq7zBs/v/J3YvKtQQiIcxfJyplPgECMWgdO0E1fKrrH8EF0QGHNJ9mJCn6PYe2UtHNS8JJf5G21e09DfYg==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"@ionic/utils-object": "2.1.6",
|
|
||||||
"@ionic/utils-terminal": "2.3.5",
|
|
||||||
"debug": "^4.0.0",
|
|
||||||
"signal-exit": "^3.0.3",
|
|
||||||
"tree-kill": "^1.2.2",
|
|
||||||
"tslib": "^2.0.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=16.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@ionic/utils-process/node_modules/signal-exit": {
|
|
||||||
"version": "3.0.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
|
|
||||||
"integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
|
|
||||||
"license": "ISC"
|
|
||||||
},
|
|
||||||
"node_modules/@ionic/utils-stream": {
|
"node_modules/@ionic/utils-stream": {
|
||||||
"version": "3.1.5",
|
"version": "3.1.5",
|
||||||
"resolved": "https://registry.npmjs.org/@ionic/utils-stream/-/utils-stream-3.1.5.tgz",
|
"resolved": "https://registry.npmjs.org/@ionic/utils-stream/-/utils-stream-3.1.5.tgz",
|
||||||
@@ -4981,9 +4954,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@welshman/signer/node_modules/@noble/hashes": {
|
"node_modules/@welshman/signer/node_modules/@noble/hashes": {
|
||||||
"version": "1.6.1",
|
"version": "1.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.7.1.tgz",
|
||||||
"integrity": "sha512-pq5D8h10hHBjyqX+cfBm0i8JUXJ0UhczFc4r74zbuT9XgewFo2E3J1cOaGtdZynILNmQ685YWGzGE1Zv6io50w==",
|
"integrity": "sha512-B8XBPsn4vT/KJAGqDzbwztd+6Yte3P4V7iafm24bxgDe/mlRuK6xmWPuCNrKt2vDafZ8MfJLlchDG/vYafQEjQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^14.21.3 || >=16"
|
"node": "^14.21.3 || >=16"
|
||||||
|
|||||||
+4
-3
@@ -37,9 +37,10 @@
|
|||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@capacitor/android": "^6.1.2",
|
"@capacitor/android": "^7.0.1",
|
||||||
"@capacitor/cli": "^6.1.2",
|
"@capacitor/app": "^7.0.0",
|
||||||
"@capacitor/core": "^6.1.2",
|
"@capacitor/cli": "^6.2.0",
|
||||||
|
"@capacitor/core": "^7.0.1",
|
||||||
"@noble/curves": "^1.5.0",
|
"@noble/curves": "^1.5.0",
|
||||||
"@noble/hashes": "^1.4.0",
|
"@noble/hashes": "^1.4.0",
|
||||||
"@poppanator/sveltekit-svg": "^4.2.1",
|
"@poppanator/sveltekit-svg": "^4.2.1",
|
||||||
|
|||||||
@@ -3,16 +3,9 @@ import {synced, throttled} from "@welshman/store"
|
|||||||
import {pubkey} from "@welshman/app"
|
import {pubkey} from "@welshman/app"
|
||||||
import {prop, spec, identity, now, groupBy} from "@welshman/lib"
|
import {prop, spec, identity, now, groupBy} from "@welshman/lib"
|
||||||
import type {TrustedEvent} from "@welshman/util"
|
import type {TrustedEvent} from "@welshman/util"
|
||||||
import {MESSAGE, COMMENT, getTagValue} from "@welshman/util"
|
import {MESSAGE, THREAD, COMMENT, getTagValue} from "@welshman/util"
|
||||||
import {makeSpacePath, makeChatPath, makeThreadPath, makeRoomPath} from "@app/routes"
|
import {makeSpacePath, makeChatPath, makeThreadPath, makeRoomPath} from "@app/routes"
|
||||||
import {
|
import {chats, getUrlsForEvent, userRoomsByUrl, repositoryStore} from "@app/state"
|
||||||
THREAD_FILTER,
|
|
||||||
COMMENT_FILTER,
|
|
||||||
chats,
|
|
||||||
getUrlsForEvent,
|
|
||||||
userRoomsByUrl,
|
|
||||||
repositoryStore,
|
|
||||||
} from "@app/state"
|
|
||||||
|
|
||||||
// Checked state
|
// Checked state
|
||||||
|
|
||||||
@@ -60,7 +53,10 @@ export const notifications = derived(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const allThreadEvents = $repository.query([THREAD_FILTER, COMMENT_FILTER])
|
const allThreadEvents = $repository.query([
|
||||||
|
{kinds: [THREAD]},
|
||||||
|
{kinds: [COMMENT], "#K": [String(THREAD)]},
|
||||||
|
])
|
||||||
const allMessageEvents = $repository.query([{kinds: [MESSAGE]}])
|
const allMessageEvents = $repository.query([{kinds: [MESSAGE]}])
|
||||||
|
|
||||||
for (const [url, rooms] of $userRoomsByUrl.entries()) {
|
for (const [url, rooms] of $userRoomsByUrl.entries()) {
|
||||||
|
|||||||
+2
-28
@@ -80,10 +80,6 @@ export const GENERAL = "_"
|
|||||||
|
|
||||||
export const PROTECTED = ["-"]
|
export const PROTECTED = ["-"]
|
||||||
|
|
||||||
export const LEGACY_MESSAGE = 209
|
|
||||||
|
|
||||||
export const LEGACY_THREAD = 309
|
|
||||||
|
|
||||||
export const INDEXER_RELAYS = [
|
export const INDEXER_RELAYS = [
|
||||||
"wss://purplepag.es/",
|
"wss://purplepag.es/",
|
||||||
"wss://relay.damus.io/",
|
"wss://relay.damus.io/",
|
||||||
@@ -118,13 +114,6 @@ export const IMGPROXY_URL = "https://imgproxy.coracle.social"
|
|||||||
|
|
||||||
export const REACTION_KINDS = [REACTION, ZAP_RESPONSE]
|
export const REACTION_KINDS = [REACTION, ZAP_RESPONSE]
|
||||||
|
|
||||||
export const THREAD_FILTER: Filter = {kinds: [THREAD, LEGACY_THREAD]}
|
|
||||||
|
|
||||||
export const COMMENT_FILTER: Filter = {
|
|
||||||
kinds: [COMMENT],
|
|
||||||
"#K": [String(THREAD), String(LEGACY_THREAD)],
|
|
||||||
}
|
|
||||||
|
|
||||||
export const NIP46_PERMS =
|
export const NIP46_PERMS =
|
||||||
"nip04_encrypt,nip04_decrypt,nip44_encrypt,nip44_decrypt," +
|
"nip04_encrypt,nip04_decrypt,nip44_encrypt,nip44_decrypt," +
|
||||||
[CLIENT_AUTH, AUTH_JOIN, MESSAGE, THREAD, COMMENT, GROUPS, WRAP, REACTION]
|
[CLIENT_AUTH, AUTH_JOIN, MESSAGE, THREAD, COMMENT, GROUPS, WRAP, REACTION]
|
||||||
@@ -463,24 +452,9 @@ export const chatSearch = derived(chats, $chats =>
|
|||||||
|
|
||||||
// Messages
|
// Messages
|
||||||
|
|
||||||
// TODO: remove support for legacy messages
|
|
||||||
export const adaptLegacyMessage = (event: TrustedEvent) => {
|
|
||||||
if (event.kind === LEGACY_MESSAGE) {
|
|
||||||
let room = event.tags.find(nthEq(0, "~"))?.[1] || GENERAL
|
|
||||||
|
|
||||||
if (room === "general") {
|
|
||||||
room = GENERAL
|
|
||||||
}
|
|
||||||
|
|
||||||
return {...event, kind: MESSAGE, tags: [...event.tags, tagRoom(room, "")]}
|
|
||||||
}
|
|
||||||
|
|
||||||
return event
|
|
||||||
}
|
|
||||||
|
|
||||||
export const messages = derived(
|
export const messages = derived(
|
||||||
deriveEvents(repository, {filters: [{kinds: [MESSAGE, LEGACY_MESSAGE]}]}),
|
deriveEvents(repository, {filters: [{kinds: [MESSAGE]}]}),
|
||||||
$events => $events.map(adaptLegacyMessage),
|
$events => $events,
|
||||||
)
|
)
|
||||||
|
|
||||||
// Nip29
|
// Nip29
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
import {onMount} from "svelte"
|
import {onMount} from "svelte"
|
||||||
import {nip19} from "nostr-tools"
|
import {nip19} from "nostr-tools"
|
||||||
import {get, derived} from "svelte/store"
|
import {get, derived} from "svelte/store"
|
||||||
|
import {App} from "@capacitor/app"
|
||||||
import {dev} from "$app/environment"
|
import {dev} from "$app/environment"
|
||||||
import {bytesToHex, hexToBytes} from "@noble/hashes/utils"
|
import {bytesToHex, hexToBytes} from "@noble/hashes/utils"
|
||||||
import {identity, sleep, take, sortBy, ago, now, HOUR, WEEK, MONTH, Worker} from "@welshman/lib"
|
import {identity, sleep, take, sortBy, ago, now, HOUR, WEEK, MONTH, Worker} from "@welshman/lib"
|
||||||
@@ -85,6 +86,14 @@
|
|||||||
setupTracking()
|
setupTracking()
|
||||||
setupAnalytics()
|
setupAnalytics()
|
||||||
|
|
||||||
|
App.addListener("backButton", () => {
|
||||||
|
if (window.history.length > 1) {
|
||||||
|
window.history.back()
|
||||||
|
} else {
|
||||||
|
App.exitApp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
ready = initStorage("flotilla", 5, {
|
ready = initStorage("flotilla", 5, {
|
||||||
relays: storageAdapters.fromCollectionStore("url", relays, {throttle: 3000}),
|
relays: storageAdapters.fromCollectionStore("url", relays, {throttle: 3000}),
|
||||||
handles: storageAdapters.fromCollectionStore("nip05", handles, {throttle: 3000}),
|
handles: storageAdapters.fromCollectionStore("nip05", handles, {throttle: 3000}),
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import {onMount} from "svelte"
|
import {onMount} from "svelte"
|
||||||
import {page} from "$app/stores"
|
import {page} from "$app/stores"
|
||||||
import {ago, WEEK} from "@welshman/lib"
|
import {ago, WEEK} from "@welshman/lib"
|
||||||
import {GROUPS, MESSAGE, DELETE} from "@welshman/util"
|
import {GROUPS, THREAD, COMMENT, MESSAGE, DELETE} from "@welshman/util"
|
||||||
import {subscribe} from "@welshman/app"
|
import {subscribe} from "@welshman/app"
|
||||||
import Page from "@lib/components/Page.svelte"
|
import Page from "@lib/components/Page.svelte"
|
||||||
import SecondaryNav from "@lib/components/SecondaryNav.svelte"
|
import SecondaryNav from "@lib/components/SecondaryNav.svelte"
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
import {pushModal} from "@app/modal"
|
import {pushModal} from "@app/modal"
|
||||||
import {setChecked} from "@app/notifications"
|
import {setChecked} from "@app/notifications"
|
||||||
import {checkRelayConnection, checkRelayAuth, checkRelayAccess} from "@app/commands"
|
import {checkRelayConnection, checkRelayAuth, checkRelayAccess} from "@app/commands"
|
||||||
import {decodeRelay, userRoomsByUrl, THREAD_FILTER, COMMENT_FILTER} from "@app/state"
|
import {decodeRelay, userRoomsByUrl} from "@app/state"
|
||||||
import {pullConservatively} from "@app/requests"
|
import {pullConservatively} from "@app/requests"
|
||||||
import {notifications} from "@app/notifications"
|
import {notifications} from "@app/notifications"
|
||||||
|
|
||||||
@@ -56,8 +56,8 @@
|
|||||||
pullConservatively({
|
pullConservatively({
|
||||||
relays,
|
relays,
|
||||||
filters: [
|
filters: [
|
||||||
{...THREAD_FILTER, since},
|
{kinds: [THREAD], since},
|
||||||
{...COMMENT_FILTER, since},
|
{kinds: [COMMENT], "#K": [String(THREAD)], since},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,6 @@
|
|||||||
deriveEventsForUrl,
|
deriveEventsForUrl,
|
||||||
GENERAL,
|
GENERAL,
|
||||||
tagRoom,
|
tagRoom,
|
||||||
LEGACY_MESSAGE,
|
|
||||||
userRoomsByUrl,
|
userRoomsByUrl,
|
||||||
displayChannel,
|
displayChannel,
|
||||||
} from "@app/state"
|
} from "@app/state"
|
||||||
@@ -47,16 +46,9 @@
|
|||||||
const content = popKey<string>("content") || ""
|
const content = popKey<string>("content") || ""
|
||||||
const url = decodeRelay($page.params.relay)
|
const url = decodeRelay($page.params.relay)
|
||||||
const relay = deriveRelay(url)
|
const relay = deriveRelay(url)
|
||||||
const legacyRoom = room === GENERAL ? "general" : room
|
|
||||||
const feeds = feedsFromFilter({kinds: [MESSAGE], "#h": [room]})
|
const feeds = feedsFromFilter({kinds: [MESSAGE], "#h": [room]})
|
||||||
|
|
||||||
const events = throttled(
|
const events = throttled(300, deriveEventsForUrl(url, [{kinds: [MESSAGE], "#h": [room]}]))
|
||||||
300,
|
|
||||||
deriveEventsForUrl(url, [
|
|
||||||
{kinds: [MESSAGE], "#h": [room]},
|
|
||||||
{kinds: [LEGACY_MESSAGE], "#~": [legacyRoom]},
|
|
||||||
]),
|
|
||||||
)
|
|
||||||
|
|
||||||
const ctrl = createFeedController({
|
const ctrl = createFeedController({
|
||||||
useWindowing: true,
|
useWindowing: true,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import {derived} from "svelte/store"
|
import {derived} from "svelte/store"
|
||||||
import {page} from "$app/stores"
|
import {page} from "$app/stores"
|
||||||
import {sortBy, min, nthEq, sleep} from "@welshman/lib"
|
import {sortBy, min, nthEq, sleep} from "@welshman/lib"
|
||||||
import {getListTags, getPubkeyTagValues} from "@welshman/util"
|
import {THREAD, COMMENT, getListTags, getPubkeyTagValues} from "@welshman/util"
|
||||||
import {throttled} from "@welshman/store"
|
import {throttled} from "@welshman/store"
|
||||||
import {feedFromFilters, makeIntersectionFeed, makeRelayFeed} from "@welshman/feeds"
|
import {feedFromFilters, makeIntersectionFeed, makeRelayFeed} from "@welshman/feeds"
|
||||||
import {createFeedController, userMutes} from "@welshman/app"
|
import {createFeedController, userMutes} from "@welshman/app"
|
||||||
@@ -16,14 +16,16 @@
|
|||||||
import MenuSpaceButton from "@app/components/MenuSpaceButton.svelte"
|
import MenuSpaceButton from "@app/components/MenuSpaceButton.svelte"
|
||||||
import ThreadItem from "@app/components/ThreadItem.svelte"
|
import ThreadItem from "@app/components/ThreadItem.svelte"
|
||||||
import ThreadCreate from "@app/components/ThreadCreate.svelte"
|
import ThreadCreate from "@app/components/ThreadCreate.svelte"
|
||||||
import {THREAD_FILTER, COMMENT_FILTER, decodeRelay, deriveEventsForUrl} from "@app/state"
|
import {decodeRelay, deriveEventsForUrl} from "@app/state"
|
||||||
import {setChecked} from "@app/notifications"
|
import {setChecked} from "@app/notifications"
|
||||||
import {pushModal} from "@app/modal"
|
import {pushModal} from "@app/modal"
|
||||||
|
|
||||||
const url = decodeRelay($page.params.relay)
|
const url = decodeRelay($page.params.relay)
|
||||||
const feed = feedFromFilters([THREAD_FILTER, COMMENT_FILTER])
|
const threadFilter = {kinds: [THREAD]}
|
||||||
const threads = deriveEventsForUrl(url, [THREAD_FILTER])
|
const commentFilter = {kinds: [COMMENT], "#K": [String(THREAD)]}
|
||||||
const comments = deriveEventsForUrl(url, [COMMENT_FILTER])
|
const feed = feedFromFilters([threadFilter, commentFilter])
|
||||||
|
const threads = deriveEventsForUrl(url, [threadFilter])
|
||||||
|
const comments = deriveEventsForUrl(url, [commentFilter])
|
||||||
const mutedPubkeys = getPubkeyTagValues(getListTags($userMutes))
|
const mutedPubkeys = getPubkeyTagValues(getListTags($userMutes))
|
||||||
|
|
||||||
const events = throttled(
|
const events = throttled(
|
||||||
|
|||||||
Reference in New Issue
Block a user