2020-09-23 03:00:56 +02:00
|
|
|
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
|
|
|
|
import Combine
|
|
|
|
import DB
|
|
|
|
import Foundation
|
|
|
|
import Mastodon
|
|
|
|
import MastodonAPI
|
|
|
|
|
|
|
|
public struct AccountService {
|
|
|
|
public let account: Account
|
2020-11-11 08:31:56 +01:00
|
|
|
public let relationship: Relationship?
|
|
|
|
public let identityProofs: [IdentityProof]
|
2020-09-25 07:39:06 +02:00
|
|
|
public let navigationService: NavigationService
|
2020-10-05 21:58:03 +02:00
|
|
|
|
2020-09-23 03:00:56 +02:00
|
|
|
private let mastodonAPIClient: MastodonAPIClient
|
|
|
|
private let contentDatabase: ContentDatabase
|
|
|
|
|
2020-11-11 08:31:56 +01:00
|
|
|
init(account: Account,
|
|
|
|
relationship: Relationship? = nil,
|
|
|
|
identityProofs: [IdentityProof] = [],
|
|
|
|
mastodonAPIClient: MastodonAPIClient,
|
|
|
|
contentDatabase: ContentDatabase) {
|
2020-09-23 03:00:56 +02:00
|
|
|
self.account = account
|
2020-11-11 08:31:56 +01:00
|
|
|
self.relationship = relationship
|
|
|
|
self.identityProofs = identityProofs
|
2020-10-05 21:58:03 +02:00
|
|
|
navigationService = NavigationService(mastodonAPIClient: mastodonAPIClient, contentDatabase: contentDatabase)
|
2020-09-23 03:00:56 +02:00
|
|
|
self.mastodonAPIClient = mastodonAPIClient
|
|
|
|
self.contentDatabase = contentDatabase
|
|
|
|
}
|
|
|
|
}
|