mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-03-26 17:52:29 +01:00
Removes new threads, boosts from the Conversations view
This commit is contained in:
parent
6225b4f843
commit
76087e5f25
@ -54,16 +54,23 @@ class NostrChatroomListNewFeedViewModel: FeedViewModel(NostrChatroomListDataSour
|
||||
}
|
||||
}
|
||||
|
||||
fun isNewThread(note: Note): Boolean {
|
||||
return note.event is RepostEvent || note.replyTo == null || note.replyTo?.size == 0
|
||||
}
|
||||
|
||||
class NostrHomeFeedViewModel: FeedViewModel(NostrHomeDataSource) {
|
||||
override fun newListFromDataSource(): List<Note> {
|
||||
// Filter: no replies
|
||||
return dataSource.feed().filter {
|
||||
it.event is RepostEvent || it.replyTo == null || it.replyTo?.size == 0
|
||||
}.take(100)
|
||||
return dataSource.feed().filter { isNewThread(it) }.take(100)
|
||||
}
|
||||
}
|
||||
|
||||
class NostrHomeRepliesFeedViewModel: FeedViewModel(NostrHomeDataSource) {}
|
||||
class NostrHomeRepliesFeedViewModel: FeedViewModel(NostrHomeDataSource) {
|
||||
override fun newListFromDataSource(): List<Note> {
|
||||
// Filter: only replies
|
||||
return dataSource.feed().filter {!isNewThread(it) }.take(100)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
abstract class FeedViewModel(val dataSource: NostrDataSource<Note>): ViewModel() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user