diff --git a/Mastodon/Scene/Discovery/ForYou/ProfileCardView.swift b/Mastodon/Scene/Discovery/ForYou/ProfileCardView.swift index 6dcdc6f49..e2d92c98e 100644 --- a/Mastodon/Scene/Discovery/ForYou/ProfileCardView.swift +++ b/Mastodon/Scene/Discovery/ForYou/ProfileCardView.swift @@ -316,9 +316,9 @@ extension ProfileCardView { buttonState = .none } else if relationship.following { buttonState = .unfollow - } else if relationship.blocking || (relationship.domainBlocking ?? false) { + } else if relationship.blocking || relationship.domainBlocking { buttonState = .blocked - } else if relationship.requested ?? false { + } else if relationship.requested { buttonState = .pending } else { buttonState = .follow diff --git a/Mastodon/Scene/Profile/Header/View/ProfileHeaderView+ViewModel.swift b/Mastodon/Scene/Profile/Header/View/ProfileHeaderView+ViewModel.swift index b87928600..25e7347f1 100644 --- a/Mastodon/Scene/Profile/Header/View/ProfileHeaderView+ViewModel.swift +++ b/Mastodon/Scene/Profile/Header/View/ProfileHeaderView+ViewModel.swift @@ -133,7 +133,7 @@ extension ProfileHeaderView.ViewModel { .compactMap { relationship in guard let relationship else { return false } - return relationship.blocking || (relationship.blockedBy ?? false) + return relationship.blocking || relationship.blockedBy } .sink { needsImageOverlayBlurred in UIView.animate(withDuration: 0.33) { diff --git a/Mastodon/Scene/Profile/ProfileViewController.swift b/Mastodon/Scene/Profile/ProfileViewController.swift index 1e4dc12d0..baff03943 100644 --- a/Mastodon/Scene/Profile/ProfileViewController.swift +++ b/Mastodon/Scene/Profile/ProfileViewController.swift @@ -420,14 +420,14 @@ extension ProfileViewController { let name = user.displayNameWithFallback var menuActions: [MastodonMenu.Action] = [ - .muteUser(.init(name: name, isMuting: relationship.muting ?? false)), + .muteUser(.init(name: name, isMuting: relationship.muting)), .blockUser(.init(name: name, isBlocking: relationship.blocking)), .reportUser(.init(name: name)), .shareUser(.init(name: name)), ] if relationship.following { - let showReblogs = relationship.showingReblogs ?? false// me.showingReblogsBy.contains(user) + let showReblogs = relationship.showingReblogs// me.showingReblogsBy.contains(user) let context = MastodonMenu.HideReblogsActionContext(showReblogs: showReblogs) menuActions.insert(.hideReblogs(context), at: 1) } diff --git a/Mastodon/Scene/Search/SearchDetail/SearchResult/SearchResultViewController+DataSourceProvider.swift b/Mastodon/Scene/Search/SearchDetail/SearchResult/SearchResultViewController+DataSourceProvider.swift index b6441e86a..b4e8b0c2e 100644 --- a/Mastodon/Scene/Search/SearchDetail/SearchResult/SearchResultViewController+DataSourceProvider.swift +++ b/Mastodon/Scene/Search/SearchDetail/SearchResult/SearchResultViewController+DataSourceProvider.swift @@ -62,7 +62,7 @@ extension SearchResultViewController { switch item { case .account(let account, relationship: _): - await DataSourceFacade.coordinateToProfileScene(provider: self, account: account) + DataSourceFacade.coordinateToProfileScene(provider: self, account: account) case .status(let status): await DataSourceFacade.coordinateToStatusThreadScene( provider: self, diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Follow.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Follow.swift index f6a5a572f..cae26cf3f 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Follow.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Follow.swift @@ -40,7 +40,7 @@ extension APIService { let response: Mastodon.Response.Content - if relationship.following || (relationship.requested ?? false) { + if relationship.following || relationship.requested { // unfollow response = try await Mastodon.API.Account.unfollow( session: session,