forked from shadowfacts/Tusker
Fix acounts not updating locally
Fix reblogged statuses potentially not updating
This commit is contained in:
parent
d008b882cb
commit
9dce94c014
|
@ -124,9 +124,19 @@ extension StatusMO {
|
||||||
self.uri = status.uri
|
self.uri = status.uri
|
||||||
self.url = status.url
|
self.url = status.url
|
||||||
self.visibility = status.visibility
|
self.visibility = status.visibility
|
||||||
self.account = container.account(for: status.account.id, in: context) ?? AccountMO(apiAccount: status.account, container: container, context: context)
|
if let existing = container.account(for: status.account.id, in: context) {
|
||||||
|
existing.updateFrom(apiAccount: status.account, container: container)
|
||||||
|
self.account = existing
|
||||||
|
} else {
|
||||||
|
self.account = AccountMO(apiAccount: status.account, container: container, context: context)
|
||||||
|
}
|
||||||
if let reblog = status.reblog {
|
if let reblog = status.reblog {
|
||||||
self.reblog = container.status(for: reblog.id, in: context) ?? StatusMO(apiStatus: reblog, container: container, context: context)
|
if let existing = container.status(for: reblog.id, in: context) {
|
||||||
|
existing.updateFrom(apiStatus: reblog, container: container)
|
||||||
|
self.reblog = existing
|
||||||
|
} else {
|
||||||
|
self.reblog = StatusMO(apiStatus: reblog, container: container, context: context)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
self.reblog = nil
|
self.reblog = nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue