mirror of
https://github.com/metabolist/metatext.git
synced 2024-09-25 12:59:59 +00:00
27 lines
820 B
Swift
27 lines
820 B
Swift
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
import Foundation
|
|
import Mastodon
|
|
|
|
public struct Profile: Codable, Hashable {
|
|
public let account: Account
|
|
public let relationship: Relationship?
|
|
public let identityProofs: [IdentityProof]
|
|
public let featuredTags: [FeaturedTag]
|
|
|
|
public init(account: Account, relationship: Relationship?) {
|
|
self.account = account
|
|
self.relationship = relationship
|
|
self.identityProofs = []
|
|
self.featuredTags = []
|
|
}
|
|
}
|
|
|
|
extension Profile {
|
|
init(info: ProfileInfo) {
|
|
account = Account(info: info.accountInfo)
|
|
relationship = info.relationship
|
|
identityProofs = info.identityProofRecords.map(IdentityProof.init(record:))
|
|
featuredTags = info.featuredTagRecords.map(FeaturedTag.init(record:))
|
|
}
|
|
}
|