Fix Equatable impl for Status and Account (thanks class)
This commit is contained in:
parent
b643dda083
commit
5d3b378373
|
@ -1,8 +1,19 @@
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
public final class Account: Codable, Identifiable, Equatable, Hashable, Sendable {
|
public final class Account: Codable, Identifiable, Hashable, Sendable, Equatable {
|
||||||
public static func == (lhs: Account, rhs: Account) -> Bool {
|
public static func == (lhs: Account, rhs: Account) -> Bool {
|
||||||
lhs.id == rhs.id
|
lhs.id == rhs.id &&
|
||||||
|
lhs.username == rhs.username &&
|
||||||
|
lhs.note.asRawText == rhs.note.asRawText &&
|
||||||
|
lhs.statusesCount == rhs.statusesCount &&
|
||||||
|
lhs.followersCount == rhs.followersCount &&
|
||||||
|
lhs.followingCount == rhs.followingCount &&
|
||||||
|
lhs.acct == rhs.acct &&
|
||||||
|
lhs.displayName == rhs.displayName &&
|
||||||
|
lhs.fields == rhs.fields &&
|
||||||
|
lhs.lastStatusAt == rhs.lastStatusAt &&
|
||||||
|
lhs.discoverable == rhs.discoverable &&
|
||||||
|
lhs.bot == rhs.bot
|
||||||
}
|
}
|
||||||
|
|
||||||
public func hash(into hasher: inout Hasher) {
|
public func hash(into hasher: inout Hasher) {
|
||||||
|
|
|
@ -74,7 +74,7 @@ public final class Status: AnyStatus, Codable, Identifiable, Equatable, Hashable
|
||||||
public var userMentioned: Bool?
|
public var userMentioned: Bool?
|
||||||
|
|
||||||
public static func == (lhs: Status, rhs: Status) -> Bool {
|
public static func == (lhs: Status, rhs: Status) -> Bool {
|
||||||
lhs.id == rhs.id
|
lhs.id == rhs.id && lhs.viewId == rhs.viewId
|
||||||
}
|
}
|
||||||
|
|
||||||
public func hash(into hasher: inout Hasher) {
|
public func hash(into hasher: inout Hasher) {
|
||||||
|
|
Loading…
Reference in New Issue