Merge branch 'main' into claude/simplify-nostrclient-api-ZpOTB
This commit is contained in:
+1
@@ -83,6 +83,7 @@ class NostrSignerExternal(
|
||||
val result = backgroundQuery.sign(unsignedEvent) ?: foregroundQuery.sign(unsignedEvent)
|
||||
|
||||
if (result is SignerResult.RequestAddressed.Successful<SignResult>) {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
(result.result.event as? T)?.let {
|
||||
return it
|
||||
}
|
||||
|
||||
+1
@@ -38,6 +38,7 @@ class GalleryListEvent(
|
||||
content: String,
|
||||
sig: HexKey,
|
||||
) : PrivateTagArrayEvent(id, pubKey, createdAt, KIND, tags, content, sig) {
|
||||
@Suppress("DEPRECATION")
|
||||
companion object {
|
||||
const val KIND = 10011
|
||||
const val ALT = "Profile Gallery"
|
||||
|
||||
@@ -36,6 +36,7 @@ data class NNote(
|
||||
return NNote(bytes.toHexKey())
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
fun create(eventId: HexKey): String = eventId.hexToByteArray().toNote()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,6 +115,7 @@ class GitReplyEvent(
|
||||
|
||||
fun rootIssueOrPatch() = tags.lastNotNullOfOrNull(MarkedETag::parseRootId)
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
companion object {
|
||||
const val KIND = 1622
|
||||
const val ALT_DESCRIPTION = "A Git Reply"
|
||||
|
||||
+5
@@ -32,12 +32,17 @@ import com.vitorpamplona.quartz.nip34Git.issue.GitIssueEvent
|
||||
import com.vitorpamplona.quartz.nip34Git.patch.GitPatchEvent
|
||||
import com.vitorpamplona.quartz.nip34Git.repository.GitRepositoryEvent
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
fun TagArrayBuilder<GitReplyEvent>.repository(rep: ATag) = addUnique(rep.toATagArray())
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
fun TagArrayBuilder<GitReplyEvent>.repository(rep: EventHintBundle<GitRepositoryEvent>) = addUnique(rep.toATag().toATagArray())
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
fun TagArrayBuilder<GitReplyEvent>.patch(rep: EventHintBundle<GitPatchEvent>) = addUnique(rep.toMarkedETag(MarkedETag.MARKER.ROOT).toTagArray())
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
fun TagArrayBuilder<GitReplyEvent>.issue(rep: EventHintBundle<GitIssueEvent>) = addUnique(rep.toMarkedETag(MarkedETag.MARKER.ROOT).toTagArray())
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
fun TagArrayBuilder<GitReplyEvent>.notify(list: List<PTag>) = pTags(list)
|
||||
|
||||
+1
@@ -111,6 +111,7 @@ class TorrentCommentEvent(
|
||||
|
||||
fun torrentIds() = tags.firstNotNullOfOrNull(MarkedETag::parseRootId) ?: tags.firstNotNullOfOrNull(ETag::parseId)
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
companion object {
|
||||
const val KIND = 2004
|
||||
const val ALT_DESCRIPTION = "Comment for a Torrent file"
|
||||
|
||||
+4
-4
@@ -32,10 +32,10 @@ package com.vitorpamplona.quartz.nip44Encryption.crypto
|
||||
*/
|
||||
object ChaCha20Core {
|
||||
// "expand 32-byte k" as little-endian integers
|
||||
private const val SIGMA0 = 0x61707865.toInt()
|
||||
private const val SIGMA1 = 0x3320646e.toInt()
|
||||
private const val SIGMA2 = 0x79622d32.toInt()
|
||||
private const val SIGMA3 = 0x6b206574.toInt()
|
||||
private const val SIGMA0 = 0x61707865
|
||||
private const val SIGMA1 = 0x3320646e
|
||||
private const val SIGMA2 = 0x79622d32
|
||||
private const val SIGMA3 = 0x6b206574
|
||||
|
||||
/**
|
||||
* ChaCha20 quarter round (RFC 8439 §2.1).
|
||||
|
||||
+1
@@ -121,6 +121,7 @@ class NostrSignerRemote(
|
||||
)
|
||||
|
||||
if (result is SignerResult.RequestAddressed.Successful<SignResult>) {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
(result.result.event as? T)?.let {
|
||||
return it
|
||||
}
|
||||
|
||||
+1
@@ -73,6 +73,7 @@ class LabeledBookmarkListEvent(
|
||||
|
||||
fun title() = tags.firstNotNullOfOrNull(TitleTag::parse)
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
fun titleOrName() = title() ?: name()
|
||||
|
||||
fun description() = tags.firstNotNullOfOrNull(DescriptionTag::parse)
|
||||
|
||||
+1
@@ -64,6 +64,7 @@ class PeopleListEvent(
|
||||
@Deprecated("NIP-51 has deprecated name. Use title instead", ReplaceWith("title()"))
|
||||
fun name() = tags.firstNotNullOfOrNull(NameTag::parse)
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
fun titleOrName() = title() ?: name()
|
||||
|
||||
fun title() = tags.firstNotNullOfOrNull(TitleTag::parse)
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
@file:Suppress("DEPRECATION")
|
||||
|
||||
package com.vitorpamplona.quartz.nip56Reports
|
||||
|
||||
import androidx.compose.runtime.Immutable
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
@file:Suppress("DEPRECATION", "UNCHECKED_CAST")
|
||||
|
||||
package com.vitorpamplona.quartz.utils
|
||||
|
||||
import com.vitorpamplona.quartz.experimental.attestations.attestation.AttestationEvent
|
||||
|
||||
+1
-2
@@ -21,7 +21,6 @@
|
||||
package com.vitorpamplona.quartz.nip96FileStorage.info
|
||||
|
||||
import java.net.URI
|
||||
import java.net.URL
|
||||
|
||||
actual fun makeAbsoluteIfRelativeUrl(
|
||||
baseUrl: String,
|
||||
@@ -32,7 +31,7 @@ actual fun makeAbsoluteIfRelativeUrl(
|
||||
if (apiUrl.isAbsolute) {
|
||||
potentiallyRelativeUrl
|
||||
} else {
|
||||
URL(URL(baseUrl), potentiallyRelativeUrl).toString()
|
||||
URI(baseUrl).resolve(potentiallyRelativeUrl).toString()
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
potentiallyRelativeUrl
|
||||
|
||||
Reference in New Issue
Block a user