mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-11 12:12:49 +02:00
Use lowercase() instead of toLowerCase() [deprecated]
This commit is contained in:
@@ -56,7 +56,7 @@ object UrlCachedPreviewer {
|
|||||||
fun preloadPreviewsFor(note: Note) {
|
fun preloadPreviewsFor(note: Note) {
|
||||||
note.event?.content?.let {
|
note.event?.content?.let {
|
||||||
findUrlsInMessage(it).forEach {
|
findUrlsInMessage(it).forEach {
|
||||||
val removedParamsFromUrl = it.split("?")[0].toLowerCase()
|
val removedParamsFromUrl = it.split("?")[0].lowercase()
|
||||||
if (imageExtension.matcher(removedParamsFromUrl).matches()) {
|
if (imageExtension.matcher(removedParamsFromUrl).matches()) {
|
||||||
// Preload Images? Isn't this too heavy?
|
// Preload Images? Isn't this too heavy?
|
||||||
} else if (videoExtension.matcher(removedParamsFromUrl).matches()) {
|
} else if (videoExtension.matcher(removedParamsFromUrl).matches()) {
|
||||||
|
@@ -259,7 +259,7 @@ class User(val pubkeyHex: String) {
|
|||||||
info?.latestMetadata = latestMetadata
|
info?.latestMetadata = latestMetadata
|
||||||
info?.updatedMetadataAt = latestMetadata.createdAt
|
info?.updatedMetadataAt = latestMetadata.createdAt
|
||||||
|
|
||||||
if (newUserInfo.lud16.isNullOrBlank() && newUserInfo.lud06?.toLowerCase()?.startsWith("lnurl") == true) {
|
if (newUserInfo.lud16.isNullOrBlank() && newUserInfo.lud06?.lowercase()?.startsWith("lnurl") == true) {
|
||||||
try {
|
try {
|
||||||
val url = String(Bech32.decodeBytes(newUserInfo.lud06!!, false).second)
|
val url = String(Bech32.decodeBytes(newUserInfo.lud06!!, false).second)
|
||||||
|
|
||||||
|
@@ -24,7 +24,7 @@ class LightningAddressResolver {
|
|||||||
return "https://${parts[1]}/.well-known/lnurlp/${parts[0]}"
|
return "https://${parts[1]}/.well-known/lnurlp/${parts[0]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lnaddress.toLowerCase().startsWith("lnurl")) {
|
if (lnaddress.lowercase().startsWith("lnurl")) {
|
||||||
return try {
|
return try {
|
||||||
String(Bech32.decodeBytes(lnaddress, false).second)
|
String(Bech32.decodeBytes(lnaddress, false).second)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
@@ -128,7 +128,7 @@ object LnInvoiceUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun multiplier(multiplier: String): BigDecimal {
|
private fun multiplier(multiplier: String): BigDecimal {
|
||||||
return when (multiplier.toLowerCase()) {
|
return when (multiplier.lowercase()) {
|
||||||
"m" -> BigDecimal("0.001")
|
"m" -> BigDecimal("0.001")
|
||||||
"u" -> BigDecimal("0.000001")
|
"u" -> BigDecimal("0.000001")
|
||||||
"n" -> BigDecimal("0.000000001")
|
"n" -> BigDecimal("0.000000001")
|
||||||
|
@@ -56,8 +56,8 @@ class ReportEvent (
|
|||||||
fun create(reportedPost: Event, type: ReportType, privateKey: ByteArray, createdAt: Long = Date().time / 1000): ReportEvent {
|
fun create(reportedPost: Event, type: ReportType, privateKey: ByteArray, createdAt: Long = Date().time / 1000): ReportEvent {
|
||||||
val content = ""
|
val content = ""
|
||||||
|
|
||||||
val reportPostTag = listOf("e", reportedPost.id, type.name.toLowerCase())
|
val reportPostTag = listOf("e", reportedPost.id, type.name.lowercase())
|
||||||
val reportAuthorTag = listOf("p", reportedPost.pubKey, type.name.toLowerCase())
|
val reportAuthorTag = listOf("p", reportedPost.pubKey, type.name.lowercase())
|
||||||
|
|
||||||
val pubKey = Utils.pubkeyCreate(privateKey).toHexKey()
|
val pubKey = Utils.pubkeyCreate(privateKey).toHexKey()
|
||||||
var tags:List<List<String>> = listOf(reportPostTag, reportAuthorTag)
|
var tags:List<List<String>> = listOf(reportPostTag, reportAuthorTag)
|
||||||
@@ -74,7 +74,7 @@ class ReportEvent (
|
|||||||
fun create(reportedUser: String, type: ReportType, privateKey: ByteArray, createdAt: Long = Date().time / 1000): ReportEvent {
|
fun create(reportedUser: String, type: ReportType, privateKey: ByteArray, createdAt: Long = Date().time / 1000): ReportEvent {
|
||||||
val content = ""
|
val content = ""
|
||||||
|
|
||||||
val reportAuthorTag = listOf("p", reportedUser, type.name.toLowerCase())
|
val reportAuthorTag = listOf("p", reportedUser, type.name.lowercase())
|
||||||
|
|
||||||
val pubKey = Utils.pubkeyCreate(privateKey).toHexKey()
|
val pubKey = Utils.pubkeyCreate(privateKey).toHexKey()
|
||||||
val tags:List<List<String>> = listOf(reportAuthorTag)
|
val tags:List<List<String>> = listOf(reportAuthorTag)
|
||||||
|
@@ -22,7 +22,7 @@ class TypedFilter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun typesToJson(types: Set<FeedType>): JsonArray {
|
fun typesToJson(types: Set<FeedType>): JsonArray {
|
||||||
return JsonArray().apply { types.forEach { add(it.name.toLowerCase()) } }
|
return JsonArray().apply { types.forEach { add(it.name.lowercase()) } }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun filterToJson(filter: JsonFilter): JsonObject {
|
fun filterToJson(filter: JsonFilter): JsonObject {
|
||||||
|
@@ -155,7 +155,7 @@ fun NewPostView(onClose: () -> Unit, baseReplyTo: Note? = null, quote: Note? = n
|
|||||||
Row(modifier = Modifier.padding(top = 5.dp)) {
|
Row(modifier = Modifier.padding(top = 5.dp)) {
|
||||||
if (isValidURL(myUrlPreview)) {
|
if (isValidURL(myUrlPreview)) {
|
||||||
val removedParamsFromUrl =
|
val removedParamsFromUrl =
|
||||||
myUrlPreview.split("?")[0].toLowerCase()
|
myUrlPreview.split("?")[0].lowercase()
|
||||||
if (imageExtension.matcher(removedParamsFromUrl).matches()) {
|
if (imageExtension.matcher(removedParamsFromUrl).matches()) {
|
||||||
AsyncImage(
|
AsyncImage(
|
||||||
model = myUrlPreview,
|
model = myUrlPreview,
|
||||||
|
@@ -141,7 +141,7 @@ fun RichTextViewer(
|
|||||||
if (lnInvoice != null) {
|
if (lnInvoice != null) {
|
||||||
InvoicePreview(lnInvoice)
|
InvoicePreview(lnInvoice)
|
||||||
} else if (isValidURL(word)) {
|
} else if (isValidURL(word)) {
|
||||||
val removedParamsFromUrl = word.split("?")[0].toLowerCase()
|
val removedParamsFromUrl = word.split("?")[0].lowercase()
|
||||||
if (imageExtension.matcher(removedParamsFromUrl).matches()) {
|
if (imageExtension.matcher(removedParamsFromUrl).matches()) {
|
||||||
ZoomableImageView(word)
|
ZoomableImageView(word)
|
||||||
} else if (videoExtension.matcher(removedParamsFromUrl).matches()) {
|
} else if (videoExtension.matcher(removedParamsFromUrl).matches()) {
|
||||||
|
Reference in New Issue
Block a user