GalleryEntryEvent: add relay hint to etag

This commit is contained in:
Believethehype
2024-07-10 21:53:25 +02:00
parent c50343cd04
commit a0a7f28304
2 changed files with 7 additions and 1 deletions

View File

@@ -2207,6 +2207,7 @@ class Account(
ProfileGalleryEntryEvent.create(
url = url,
eventid = idHex,
relayhint = relay,
/*magnetUri = magnetUri,
mimeType = headerInfo.mimeType,
hash = headerInfo.hash,

View File

@@ -83,6 +83,7 @@ class ProfileGalleryEntryEvent(
fun create(
url: String,
eventid: String? = null,
relayhint: String? = null,
magnetUri: String? = null,
mimeType: String? = null,
alt: String? = null,
@@ -99,10 +100,14 @@ class ProfileGalleryEntryEvent(
createdAt: Long = TimeUtils.now(),
onReady: (ProfileGalleryEntryEvent) -> Unit,
) {
var etag = eventid?.let { arrayOf("e", it) }
relayhint?.let { etag = etag?.plus(it) }
println("RELAYHINT: " + etag)
val tags =
listOfNotNull(
arrayOf(URL, url),
eventid?.let { arrayOf("e", it) },
eventid?.let { etag },
magnetUri?.let { arrayOf(MAGNET_URI, it) },
mimeType?.let { arrayOf(MIME_TYPE, it) },
alt?.ifBlank { null }?.let { arrayOf(ALT, it) } ?: arrayOf("alt", ALT_DESCRIPTION),