Remove obsolete wrapper-code

This commit is contained in:
Nathan Mattes 2024-01-01 20:10:37 +01:00
parent ab7b0584dd
commit a6aa4291f6
1 changed files with 2 additions and 23 deletions

View File

@ -23,14 +23,8 @@ extension APIService {
@discardableResult
public func getBlocked(
authenticationBox: MastodonAuthenticationBox
) async throws -> Mastodon.Response.Content<[Mastodon.Entity.Account]> {
try await _getBlocked(sinceID: nil, limit: nil, authenticationBox: authenticationBox)
}
private func _getBlocked(
sinceID: Mastodon.Entity.Status.ID?,
limit: Int?,
sinceID: Mastodon.Entity.Status.ID? = nil,
limit: Int? = nil,
authenticationBox: MastodonAuthenticationBox
) async throws -> Mastodon.Response.Content<[Mastodon.Entity.Account]> {
let managedObjectContext = backgroundManagedObjectContext
@ -42,21 +36,6 @@ extension APIService {
authorization: authenticationBox.userAuthorization
).singleOutput()
let userIDs = response.value.map { $0.id }
let predicate = MastodonUser.predicate(domain: authenticationBox.domain, ids: userIDs)
let fetchRequest = MastodonUser.fetchRequest()
fetchRequest.predicate = predicate
fetchRequest.includesPropertyValues = false
try await managedObjectContext.performChanges {
let users = try managedObjectContext.fetch(fetchRequest) as! [MastodonUser]
for user in users {
user.deleteStatusAndNotificationFeeds(in: managedObjectContext)
}
}
return response
}