2023-01-05 11:55:20 +01:00
|
|
|
//
|
|
|
|
// https://mczachurski.dev
|
|
|
|
// Copyright © 2023 Marcin Czachurski and the repository contributors.
|
2023-03-28 10:35:38 +02:00
|
|
|
// Licensed under the Apache License 2.0.
|
2023-01-05 11:55:20 +01:00
|
|
|
//
|
2023-04-01 12:10:59 +02:00
|
|
|
|
2023-01-05 11:55:20 +01:00
|
|
|
import Foundation
|
2023-02-19 10:32:38 +01:00
|
|
|
import PixelfedKit
|
2023-01-05 11:55:20 +01:00
|
|
|
|
|
|
|
extension StatusData {
|
|
|
|
func copyFrom(_ status: Status) {
|
2023-01-26 15:10:47 +01:00
|
|
|
if let reblog = status.reblog {
|
|
|
|
self.copyFrom(reblog)
|
2023-04-01 12:10:59 +02:00
|
|
|
|
2023-01-26 15:10:47 +01:00
|
|
|
self.rebloggedStatusId = status.id
|
|
|
|
self.rebloggedAccountAvatar = status.account.avatar
|
|
|
|
self.rebloggedAccountDisplayName = status.account.displayName
|
|
|
|
self.rebloggedAccountId = status.account.id
|
|
|
|
self.rebloggedAccountUsername = status.account.acct
|
|
|
|
} else {
|
|
|
|
self.id = status.id
|
|
|
|
self.createdAt = status.createdAt
|
|
|
|
self.accountAvatar = status.account.avatar
|
|
|
|
self.accountDisplayName = status.account.displayName
|
|
|
|
self.accountId = status.account.id
|
|
|
|
self.accountUsername = status.account.acct
|
|
|
|
self.applicationName = status.application?.name
|
|
|
|
self.applicationWebsite = status.application?.website
|
|
|
|
self.bookmarked = status.bookmarked
|
2023-02-24 15:52:57 +01:00
|
|
|
self.content = status.content.htmlValue
|
2023-01-26 15:10:47 +01:00
|
|
|
self.favourited = status.favourited
|
|
|
|
self.favouritesCount = Int32(status.favouritesCount)
|
|
|
|
self.inReplyToAccount = status.inReplyToAccount
|
|
|
|
self.inReplyToId = status.inReplyToId
|
|
|
|
self.muted = status.muted
|
|
|
|
self.pinned = status.pinned
|
|
|
|
self.reblogged = status.reblogged
|
|
|
|
self.reblogsCount = Int32(status.reblogsCount)
|
|
|
|
self.repliesCount = Int32(status.repliesCount)
|
|
|
|
self.sensitive = status.sensitive
|
|
|
|
self.spoilerText = status.spoilerText
|
|
|
|
self.uri = status.uri
|
|
|
|
self.url = status.url
|
|
|
|
self.visibility = status.visibility.rawValue
|
|
|
|
}
|
2023-01-05 11:55:20 +01:00
|
|
|
}
|
|
|
|
}
|