diff --git a/Mastodon/Protocol/Provider/DataSourceFacade+Model.swift b/Mastodon/Protocol/Provider/DataSourceFacade+Model.swift index 9364cbc24..42e44d832 100644 --- a/Mastodon/Protocol/Provider/DataSourceFacade+Model.swift +++ b/Mastodon/Protocol/Provider/DataSourceFacade+Model.swift @@ -25,19 +25,3 @@ extension DataSourceFacade { } } } - -extension DataSourceFacade { - static func author( - managedObjectContext: NSManagedObjectContext, - status: MastodonStatus, - target: StatusTarget - ) async -> ManagedObjectRecord? { - return try? await managedObjectContext.perform { - return DataSourceFacade.status(managedObjectContext: managedObjectContext, status: status, target: target) - .flatMap { $0.entity.account } - .flatMap { - MastodonUser.findOrFetch(in: managedObjectContext, matching: MastodonUser.predicate(domain: $0.domain ?? "", id: $0.id))?.asRecord - } - } - } -} diff --git a/Mastodon/Scene/Notification/NotificationTimeline/NotificationTimelineViewController.swift b/Mastodon/Scene/Notification/NotificationTimeline/NotificationTimelineViewController.swift index d4c68c09f..053ce9e76 100644 --- a/Mastodon/Scene/Notification/NotificationTimeline/NotificationTimelineViewController.swift +++ b/Mastodon/Scene/Notification/NotificationTimeline/NotificationTimelineViewController.swift @@ -276,6 +276,7 @@ extension NotificationTimelineViewController: TableViewControllerNavigateable { guard let indexPathForSelectedRow = tableView.indexPathForSelectedRow else { return } guard let diffableDataSource = viewModel.diffableDataSource else { return } guard let item = diffableDataSource.itemIdentifier(for: indexPathForSelectedRow) else { return } + let domain = authContext.mastodonAuthenticationBox.domain Task { @MainActor in switch item { @@ -296,7 +297,7 @@ extension NotificationTimelineViewController: TableViewControllerNavigateable { } else { context.managedObjectContext.perform { let mastodonUserRequest = MastodonUser.sortedFetchRequest - mastodonUserRequest.predicate = MastodonUser.predicate(domain: notification.account.domain ?? "", id: notification.account.id) + mastodonUserRequest.predicate = MastodonUser.predicate(domain: domain, id: notification.account.id) mastodonUserRequest.fetchLimit = 1 guard let mastodonUser = try? self.context.managedObjectContext.fetch(mastodonUserRequest).first else { return diff --git a/MastodonSDK/Sources/MastodonUI/View/Content/StatusView+Configuration.swift b/MastodonSDK/Sources/MastodonUI/View/Content/StatusView+Configuration.swift index 245521d3d..2b62211f7 100644 --- a/MastodonSDK/Sources/MastodonUI/View/Content/StatusView+Configuration.swift +++ b/MastodonSDK/Sources/MastodonUI/View/Content/StatusView+Configuration.swift @@ -142,15 +142,6 @@ extension StatusView { } } else { // B. replyTo status not exist - -// let request = MastodonUser.sortedFetchRequest -// request.predicate = MastodonUser.predicate(domain: status.domain, id: inReplyToAccountID) -// if let user = status.managedObjectContext?.safeFetch(request).first { -// // B1. replyTo user exist -// let header = createHeader(name: user.displayNameWithFallback, emojis: user.emojis.asDictionary) -// viewModel.header = header -// } else { - // B2. replyTo user not exist let header = createHeader(name: nil, emojis: nil) viewModel.header = header