kopia lustrzana https://github.com/vitorpamplona/amethyst
Minimizes memory use to calculate zaps.
rodzic
a0a10b2cd0
commit
77789379c0
|
@ -535,7 +535,7 @@ open class Note(val idHex: String) {
|
||||||
option: Int?,
|
option: Int?,
|
||||||
user: User,
|
user: User,
|
||||||
account: Account,
|
account: Account,
|
||||||
remainingZapEvents: List<Pair<Note, Note?>>,
|
remainingZapEvents: Map<Note, Note?>,
|
||||||
onWasZappedByAuthor: () -> Unit,
|
onWasZappedByAuthor: () -> Unit,
|
||||||
) {
|
) {
|
||||||
if (remainingZapEvents.isEmpty()) {
|
if (remainingZapEvents.isEmpty()) {
|
||||||
|
@ -543,8 +543,8 @@ open class Note(val idHex: String) {
|
||||||
}
|
}
|
||||||
|
|
||||||
remainingZapEvents.forEach { next ->
|
remainingZapEvents.forEach { next ->
|
||||||
val zapRequest = next.first.event as LnZapRequestEvent
|
val zapRequest = next.key.event as LnZapRequestEvent
|
||||||
val zapEvent = next.second?.event as? LnZapEvent
|
val zapEvent = next.value?.event as? LnZapEvent
|
||||||
|
|
||||||
if (!zapRequest.isPrivateZap()) {
|
if (!zapRequest.isPrivateZap()) {
|
||||||
// public events
|
// public events
|
||||||
|
@ -588,7 +588,7 @@ open class Note(val idHex: String) {
|
||||||
account: Account,
|
account: Account,
|
||||||
onWasZappedByAuthor: () -> Unit,
|
onWasZappedByAuthor: () -> Unit,
|
||||||
) {
|
) {
|
||||||
isZappedByCalculation(null, user, account, zaps.toList(), onWasZappedByAuthor)
|
isZappedByCalculation(null, user, account, zaps, onWasZappedByAuthor)
|
||||||
if (account.userProfile() == user) {
|
if (account.userProfile() == user) {
|
||||||
recursiveIsPaidByCalculation(account, zapPayments.toList(), onWasZappedByAuthor)
|
recursiveIsPaidByCalculation(account, zapPayments.toList(), onWasZappedByAuthor)
|
||||||
}
|
}
|
||||||
|
@ -600,7 +600,7 @@ open class Note(val idHex: String) {
|
||||||
account: Account,
|
account: Account,
|
||||||
onWasZappedByAuthor: () -> Unit,
|
onWasZappedByAuthor: () -> Unit,
|
||||||
) {
|
) {
|
||||||
isZappedByCalculation(option, user, account, zaps.toList(), onWasZappedByAuthor)
|
isZappedByCalculation(option, user, account, zaps, onWasZappedByAuthor)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getReactionBy(user: User): String? {
|
fun getReactionBy(user: User): String? {
|
||||||
|
|
Ładowanie…
Reference in New Issue