kopia lustrzana https://github.com/vitorpamplona/amethyst
Refactoring
rodzic
dd8904de15
commit
7cf7c9f082
|
@ -20,13 +20,11 @@ class ChatroomListKnownFeedFilter(val account: Account) : AdditiveFeedFilter<Not
|
|||
val me = account.userProfile()
|
||||
val followingKeySet = account.followingKeySet()
|
||||
|
||||
val messagingWith = me.privateChatrooms.filter {
|
||||
(
|
||||
it.value.senderIntersects(followingKeySet) || me.hasSentMessagesTo(it.key)
|
||||
) && !account.isAllHidden(it.key.users)
|
||||
val knownChatrooms = me.privateChatrooms.filter {
|
||||
(it.value.senderIntersects(followingKeySet) || me.hasSentMessagesTo(it.key)) && !account.isAllHidden(it.key.users)
|
||||
}
|
||||
|
||||
val privateMessages = messagingWith.mapNotNull { it ->
|
||||
val privateMessages = knownChatrooms.mapNotNull { it ->
|
||||
it.value
|
||||
.roomMessages
|
||||
.sortedWith(compareBy({ it.createdAt() }, { it.idHex }))
|
||||
|
|
|
@ -19,12 +19,11 @@ class ChatroomListNewFeedFilter(val account: Account) : AdditiveFeedFilter<Note>
|
|||
val me = account.userProfile()
|
||||
val followingKeySet = account.followingKeySet()
|
||||
|
||||
val privateChatrooms = account.userProfile().privateChatrooms
|
||||
val messagingWith = privateChatrooms.filter {
|
||||
val newChatrooms = me.privateChatrooms.filter {
|
||||
!it.value.senderIntersects(followingKeySet) && !me.hasSentMessagesTo(it.key) && !account.isAllHidden(it.key.users)
|
||||
}
|
||||
|
||||
val privateMessages = messagingWith.mapNotNull { it ->
|
||||
val privateMessages = newChatrooms.mapNotNull { it ->
|
||||
it.value
|
||||
.roomMessages
|
||||
.sortedWith(compareBy({ it.createdAt() }, { it.idHex }))
|
||||
|
|
Ładowanie…
Reference in New Issue