mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-04-09 12:30:41 +02:00
Counts quotes as retweets in the notification stats bar
This commit is contained in:
parent
7d9784ee44
commit
b88ab06154
@ -68,11 +68,11 @@ import com.vitorpamplona.amethyst.ui.theme.Size24Modifier
|
||||
import com.vitorpamplona.amethyst.ui.theme.StdHorzSpacer
|
||||
import com.vitorpamplona.amethyst.ui.theme.placeholderText
|
||||
import com.vitorpamplona.quartz.encoders.HexKey
|
||||
import com.vitorpamplona.quartz.events.BaseTextNoteEvent
|
||||
import com.vitorpamplona.quartz.events.GenericRepostEvent
|
||||
import com.vitorpamplona.quartz.events.LnZapEvent
|
||||
import com.vitorpamplona.quartz.events.ReactionEvent
|
||||
import com.vitorpamplona.quartz.events.RepostEvent
|
||||
import com.vitorpamplona.quartz.events.TextNoteEvent
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
@ -256,10 +256,19 @@ class UserReactionsViewModel(val account: Account) : ViewModel() {
|
||||
(zaps[netDate] ?: BigDecimal.ZERO) + (noteEvent.amount ?: BigDecimal.ZERO)
|
||||
takenIntoAccount.add(noteEvent.id())
|
||||
}
|
||||
} else if (noteEvent is TextNoteEvent) {
|
||||
} else if (noteEvent is BaseTextNoteEvent) {
|
||||
if (noteEvent.isTaggedUser(currentUser) && noteEvent.pubKey != currentUser) {
|
||||
val isCitation =
|
||||
noteEvent.findCitations().any {
|
||||
LocalCache.getNoteIfExists(it)?.author?.pubkeyHex == currentUser
|
||||
}
|
||||
|
||||
val netDate = formatDate(noteEvent.createdAt)
|
||||
replies[netDate] = (replies[netDate] ?: 0) + 1
|
||||
if (isCitation) {
|
||||
boosts[netDate] = (boosts[netDate] ?: 0) + 1
|
||||
} else {
|
||||
replies[netDate] = (replies[netDate] ?: 0) + 1
|
||||
}
|
||||
takenIntoAccount.add(noteEvent.id())
|
||||
}
|
||||
}
|
||||
@ -315,10 +324,19 @@ class UserReactionsViewModel(val account: Account) : ViewModel() {
|
||||
takenIntoAccount.add(noteEvent.id())
|
||||
hasNewElements = true
|
||||
}
|
||||
} else if (noteEvent is TextNoteEvent) {
|
||||
} else if (noteEvent is BaseTextNoteEvent) {
|
||||
if (noteEvent.isTaggedUser(currentUser) && noteEvent.pubKey != currentUser) {
|
||||
val isCitation =
|
||||
noteEvent.findCitations().any {
|
||||
LocalCache.getNoteIfExists(it)?.author?.pubkeyHex == currentUser
|
||||
}
|
||||
|
||||
val netDate = formatDate(noteEvent.createdAt)
|
||||
replies[netDate] = (replies[netDate] ?: 0) + 1
|
||||
if (isCitation) {
|
||||
boosts[netDate] = (boosts[netDate] ?: 0) + 1
|
||||
} else {
|
||||
replies[netDate] = (replies[netDate] ?: 0) + 1
|
||||
}
|
||||
takenIntoAccount.add(noteEvent.id())
|
||||
hasNewElements = true
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user