Testing image uploads with Account info

This commit is contained in:
Vitor Pamplona
2023-08-15 11:57:28 -04:00
parent 1ad1d233cd
commit f7e9898637
3 changed files with 35 additions and 72 deletions
@@ -74,8 +74,8 @@ class Account(
var hideBlockAlertDialog: Boolean = false,
var hideNIP24WarningDialog: Boolean = false,
var backupContactList: ContactListEvent? = null,
var proxy: Proxy?,
var proxyPort: Int,
var proxy: Proxy? = null,
var proxyPort: Int = 9050,
var showSensitiveContent: Boolean? = null,
var warnAboutPostsWithReports: Boolean = true,
var filterSpamFromStrangers: Boolean = true,
@@ -140,9 +140,7 @@ object ImageUploader {
}
fun NIP98Header(url: String, method: String, body: String): String {
val noteJson = if (this::account.isInitialized) {
account.createHTTPAuthorization(url, method, body)?.toJson() ?: ""
} else { "" }
val noteJson = account.createHTTPAuthorization(url, method, body)?.toJson() ?: ""
val encodedNIP98Event: String = Base64.getEncoder().encodeToString(noteJson.toByteArray())
return "Nostr " + encodedNIP98Event