Avoids displaying a NIP-94 event without a url tag

pull/549/head
Vitor Pamplona 2023-08-14 16:33:47 -04:00
rodzic d934e28b3a
commit 6ab061a5a2
2 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -26,6 +26,8 @@ class FileHeaderEvent(
fun torrentInfoHash() = tags.firstOrNull { it.size > 1 && it[0] == TORRENT_INFOHASH }?.get(1)
fun blurhash() = tags.firstOrNull { it.size > 1 && it[0] == BLUR_HASH }?.get(1)
fun hasUrl() = tags.any { it.size > 1 && it[0] == URL }
companion object {
const val kind = 1063

Wyświetl plik

@ -37,7 +37,7 @@ class VideoFeedFilter(val account: Account) : AdditiveFeedFilter<Note>() {
return collection
.asSequence()
.filter { it.event is FileHeaderEvent || it.event is FileStorageHeaderEvent }
.filter { (it.event is FileHeaderEvent && (it.event as FileHeaderEvent).hasUrl()) || it.event is FileStorageHeaderEvent }
.filter { isGlobal || it.author?.pubkeyHex in followingKeySet || (it.event?.isTaggedHashes(followingTagSet) ?: false) || (it.event?.isTaggedGeoHashes(followingGeohashSet) ?: false) }
.filter { isHiddenList || account.isAcceptable(it) }
.filter { it.createdAt()!! <= now }