Skip to content

Commit

Permalink
Fix insertRelayHints to work with minimal p tags
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandarIlic committed Dec 30, 2024
1 parent 80960bf commit 5432a9d
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,14 @@ class NotePublishHandler @Inject constructor(
this.map {
val noteId = it[1].jsonPrimitive.content
val relayHint = relayHintsMap.getOrDefault(key = noteId, defaultValue = "")
JsonArray(it.toMutableList().apply { this[2] = JsonPrimitive(relayHint) })
JsonArray(
it.toMutableList().apply {
if (this.size > 2) {
this[2] = JsonPrimitive(relayHint)
} else {
add(index = 2, JsonPrimitive(relayHint))
}
},
)
}
}

0 comments on commit 5432a9d

Please sign in to comment.