mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-11-10 23:36:42 +01:00
avoiding deprecated .put api
This commit is contained in:
@@ -62,9 +62,16 @@ class SinceAuthorPerRelayFilter(
|
||||
if (isNotEmpty()) {
|
||||
val jsonObjectPerRelayAuthors = factory.objectNode()
|
||||
entries.forEach { relayAuthorPairs ->
|
||||
jsonObjectPerRelayAuthors.put(relayAuthorPairs.key, factory.arrayNode(relayAuthorPairs.value.size).apply { relayAuthorPairs.value.forEach { add(it) } })
|
||||
jsonObjectPerRelayAuthors.replace(
|
||||
relayAuthorPairs.key,
|
||||
factory.arrayNode(relayAuthorPairs.value.size).apply {
|
||||
relayAuthorPairs.value.forEach {
|
||||
add(it)
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
obj.put("authors", jsonObjectPerRelayAuthors)
|
||||
obj.replace("authors", jsonObjectPerRelayAuthors)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +81,7 @@ class SinceAuthorPerRelayFilter(
|
||||
entries.forEach { sincePairs ->
|
||||
jsonObjectSince.put(sincePairs.key, "${sincePairs.value}")
|
||||
}
|
||||
obj.put("since", jsonObjectSince)
|
||||
obj.replace("since", jsonObjectSince)
|
||||
}
|
||||
}
|
||||
return EventMapper.mapper.writeValueAsString(obj)
|
||||
|
||||
@@ -61,7 +61,7 @@ class SincePerRelayFilter(
|
||||
entries.forEach { sincePairs ->
|
||||
jsonObjectSince.put(sincePairs.key, "${sincePairs.value}")
|
||||
}
|
||||
obj.put("since", jsonObjectSince)
|
||||
obj.replace("since", jsonObjectSince)
|
||||
}
|
||||
}
|
||||
return EventMapper.toJson(obj)
|
||||
|
||||
Reference in New Issue
Block a user