Use account for reblogged statuses (stati?) (IOS-192)

This commit is contained in:
Nathan Mattes 2023-12-30 10:36:10 +01:00
parent 47986262bc
commit 922f7116dd
1 changed files with 4 additions and 9 deletions

View File

@ -88,16 +88,11 @@ extension StatusView {
private func configureHeader(status: MastodonStatus) {
if status.entity.reblogged == true,
let authenticationBox = viewModel.authContext?.mastodonAuthenticationBox,
let managedObjectContext = viewModel.context?.managedObjectContext {
let user = MastodonUser.findOrFetch(
in: managedObjectContext,
matching: MastodonUser.predicate(domain: authenticationBox.domain, id: authenticationBox.userID)
)
let account = authenticationBox.authentication.account() {
let name = account.displayNameWithFallback
let emojis = account.emojis ?? []
let name = user?.displayNameWithFallback ?? authenticationBox.authentication.username
let emojis = user?.emojis ?? []
viewModel.header = {
let text = L10n.Common.Controls.Status.userReblogged(name)
let content = MastodonContent(content: text, emojis: emojis.asDictionary)