From 71b28cb9779fbe3e9731b29235346326f778e607 Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Thu, 28 Dec 2023 23:43:27 +0100 Subject: [PATCH] We don't use the author when composing toots (IOS-192) --- .../ComposeContent/ComposeContentViewModel.swift | 11 ++--------- .../Publisher/MastodonStatusPublisher.swift | 7 ------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewModel.swift b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewModel.swift index 5539f80ee..9ee1cab64 100644 --- a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewModel.swift +++ b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewModel.swift @@ -552,14 +552,8 @@ extension ComposeContentViewModel { public func statusPublisher() throws -> StatusPublisher { let authContext = self.authContext - - // author - let managedObjectContext = self.context.managedObjectContext - var _author: ManagedObjectRecord? - managedObjectContext.performAndWait { - _author = authContext.mastodonAuthenticationBox.authentication.user(in: managedObjectContext)?.asRecord - } - guard let author = _author else { + + guard authContext.mastodonAuthenticationBox.authentication.account() != nil else { throw AppError.badAuthentication } @@ -582,7 +576,6 @@ extension ComposeContentViewModel { } return MastodonStatusPublisher( - author: author, replyTo: { if case .reply(let status) = destination { return status diff --git a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Publisher/MastodonStatusPublisher.swift b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Publisher/MastodonStatusPublisher.swift index 9db9faed9..1c519a857 100644 --- a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Publisher/MastodonStatusPublisher.swift +++ b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Publisher/MastodonStatusPublisher.swift @@ -13,11 +13,6 @@ import MastodonCore import MastodonSDK public final class MastodonStatusPublisher: NSObject, ProgressReporting { - - // Input - - // author - public let author: ManagedObjectRecord // refer public let replyTo: MastodonStatus? // content warning @@ -47,7 +42,6 @@ public final class MastodonStatusPublisher: NSObject, ProgressReporting { public var reactor: StatusPublisherReactor? public init( - author: ManagedObjectRecord, replyTo: MastodonStatus?, isContentWarningComposing: Bool, contentWarning: String, @@ -61,7 +55,6 @@ public final class MastodonStatusPublisher: NSObject, ProgressReporting { visibility: Mastodon.Entity.Status.Visibility, language: String ) { - self.author = author self.replyTo = replyTo self.isContentWarningComposing = isContentWarningComposing self.contentWarning = contentWarning