mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-28 07:47:03 +02:00
Deleting awards cache.
This commit is contained in:
@@ -305,11 +305,6 @@ object LocalCache {
|
|||||||
it.addTaggedPost(note)
|
it.addTaggedPost(note)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Counts the replies
|
|
||||||
awardees.forEach {
|
|
||||||
it.addBadgeAward(note)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Replies of an Badge Definition are Award Events
|
// Replies of an Badge Definition are Award Events
|
||||||
awardDefinition.forEach {
|
awardDefinition.forEach {
|
||||||
it.addReply(note)
|
it.addReply(note)
|
||||||
|
@@ -60,9 +60,6 @@ class User(val pubkeyHex: String) {
|
|||||||
var privateChatrooms = mapOf<User, Chatroom>()
|
var privateChatrooms = mapOf<User, Chatroom>()
|
||||||
private set
|
private set
|
||||||
|
|
||||||
var badgeAwards = setOf<Note>()
|
|
||||||
private set
|
|
||||||
|
|
||||||
var acceptedBadges: AddressableNote? = null
|
var acceptedBadges: AddressableNote? = null
|
||||||
|
|
||||||
fun pubkey() = Hex.decode(pubkeyHex)
|
fun pubkey() = Hex.decode(pubkeyHex)
|
||||||
@@ -185,18 +182,6 @@ class User(val pubkeyHex: String) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun addBadgeAward(note: Note) {
|
|
||||||
if (note !in badgeAwards) {
|
|
||||||
badgeAwards = badgeAwards + note
|
|
||||||
liveSet?.badges?.invalidateData()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun removeBadgeAward(deleteNote: Note) {
|
|
||||||
badgeAwards = badgeAwards - deleteNote
|
|
||||||
liveSet?.badges?.invalidateData()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun updateAcceptedBadges(note: AddressableNote) {
|
fun updateAcceptedBadges(note: AddressableNote) {
|
||||||
acceptedBadges = note
|
acceptedBadges = note
|
||||||
liveSet?.badges?.invalidateData()
|
liveSet?.badges?.invalidateData()
|
||||||
|
Reference in New Issue
Block a user