Fix handling of (re-)reblogged and favorites state in home timeline (IOS-176)
This commit is contained in:
parent
1dfcf407e1
commit
c7d62d56a2
|
@ -47,15 +47,24 @@ final public class FeedFetchedResultsController {
|
||||||
} else if let reblog = status.reblog, reblog.id == record.status?.id {
|
} else if let reblog = status.reblog, reblog.id == record.status?.id {
|
||||||
newRecords[i] = .fromStatus(status, kind: record.kind)
|
newRecords[i] = .fromStatus(status, kind: record.kind)
|
||||||
} else if let reblog = record.status?.reblog, reblog.id == status.id {
|
} else if let reblog = record.status?.reblog, reblog.id == status.id {
|
||||||
newRecords[i] = .fromStatus(status, kind: record.kind)
|
// Handle reblogged state
|
||||||
switch status.entity.reblogged {
|
switch status.entity.reblogged {
|
||||||
case .some(true):
|
case .some(true):
|
||||||
newRecords[i].status?.reblog = status
|
newRecords[i] = .fromStatus({
|
||||||
case .some(false):
|
let stat = MastodonStatus.fromEntity(records[i].status!.entity)
|
||||||
newRecords[i].status?.reblog = nil
|
stat.reblog = .fromEntity(status.entity)
|
||||||
case .none:
|
return stat
|
||||||
break
|
}(), kind: record.kind)
|
||||||
|
case .some(false), .none:
|
||||||
|
newRecords[i] = .fromStatus({
|
||||||
|
let stat = MastodonStatus.fromEntity(status.entity)
|
||||||
|
return stat
|
||||||
|
}(), kind: record.kind)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else if let reblog = record.status?.reblog, reblog.id == status.reblog?.id {
|
||||||
|
// Handle re-reblogged state
|
||||||
|
newRecords[i] = .fromStatus(status, kind: record.kind)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
records = newRecords
|
records = newRecords
|
||||||
|
|
Loading…
Reference in New Issue