Fix comparing statuses and diffing in NotificationsFragment (#2318)

This commit is contained in:
Konrad Pozniak 2022-02-07 20:38:54 +01:00 committed by GitHub
commit 2fd45c1cdb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 31 deletions

View file

@ -55,10 +55,11 @@ data class Status(
val actionableStatus: Status
get() = reblog ?: this
/** Helper for Java */
/** Helpers for Java */
fun copyWithFavourited(favourited: Boolean): Status = copy(favourited = favourited)
fun copyWithReblogged(reblogged: Boolean): Status = copy(reblogged = reblogged)
fun copyWithBookmarked(bookmarked: Boolean): Status = copy(bookmarked = bookmarked)
fun copyWithPoll(poll: Poll?): Status = copy(poll = poll)
/** Helper for Java */
fun copyWithPinned(pinned: Boolean): Status = copy(pinned = pinned)
enum class Visibility(val num: Int) {
@ -147,18 +148,6 @@ data class Status(
return builder.toString()
}
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other == null || javaClass != other.javaClass) return false
val status = other as Status?
return id == status?.id
}
override fun hashCode(): Int {
return id.hashCode()
}
data class Mention(
val id: String,
val url: String,