mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-03-26 17:52:29 +01:00
Presents notifications when a person forks your content.
This commit is contained in:
parent
c53fc03157
commit
786802b708
@ -747,7 +747,9 @@ object LocalCache {
|
||||
|
||||
if (version.event == null) {
|
||||
version.loadEvent(event, author, emptyList())
|
||||
|
||||
if (version.liveSet != null) {
|
||||
updateListCache()
|
||||
}
|
||||
version.liveSet?.innerOts?.invalidateData()
|
||||
}
|
||||
|
||||
@ -1406,8 +1408,8 @@ object LocalCache {
|
||||
event.editedNote()?.let {
|
||||
checkGetOrCreateNote(it)?.let { editedNote ->
|
||||
modificationCache.remove(editedNote.idHex)
|
||||
// if it is a new post from the user, must update list of Notes to quickly update the user.
|
||||
if (relay == null) {
|
||||
// must update list of Notes to quickly update the user.
|
||||
if (editedNote.liveSet != null) {
|
||||
updateListCache()
|
||||
}
|
||||
editedNote.liveSet?.innerModifications?.invalidateData()
|
||||
|
@ -99,8 +99,10 @@ class NotificationFeedFilter(val account: Account) : AdditiveFeedFilter<Note>()
|
||||
|
||||
val isAuthoredPostCited = event.findCitations().any { LocalCache.getNoteIfExists(it)?.author?.pubkeyHex == authorHex }
|
||||
val isAuthorDirectlyCited = event.citedUsers().contains(authorHex)
|
||||
val isAuthorOfAFork =
|
||||
event.isForkFromAddressWithPubkey(authorHex) || (event.forkFromVersion()?.let { LocalCache.getNoteIfExists(it)?.author?.pubkeyHex == authorHex } == true)
|
||||
|
||||
return isAuthoredPostCited || isAuthorDirectlyCited
|
||||
return isAuthoredPostCited || isAuthorDirectlyCited || isAuthorOfAFork
|
||||
}
|
||||
|
||||
if (event is ReactionEvent) {
|
||||
|
@ -55,6 +55,8 @@ open class BaseTextNoteEvent(
|
||||
|
||||
fun forkFromVersion() = tags.firstOrNull { it.size > 3 && it[0] == "e" && it[3] == "fork" }?.get(1)
|
||||
|
||||
fun isForkFromAddressWithPubkey(authorHex: HexKey) = tags.any { it.size > 3 && it[0] == "a" && it[3] == "fork" && it[1].contains(authorHex) }
|
||||
|
||||
open fun replyTos(): List<HexKey> {
|
||||
val oldStylePositional = tags.filter { it.size > 1 && it.size <= 3 && it[0] == "e" }.map { it[1] }
|
||||
val newStyleReply = tags.lastOrNull { it.size > 3 && it[0] == "e" && it[3] == "reply" }?.get(1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user