From 52f5458364b268a3a6d0249c9747ff2709867d3b Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Mon, 19 Feb 2024 12:05:34 +0100 Subject: [PATCH] Fix build --- Mastodon/Protocol/Provider/DataSourceFacade+Block.swift | 2 +- Mastodon/Protocol/Provider/DataSourceFacade+Follow.swift | 6 +++--- Mastodon/Protocol/Provider/DataSourceFacade+Mute.swift | 2 +- .../Scene/Discovery/ForYou/ProfileCardView+ViewModel.swift | 2 +- Mastodon/Scene/Profile/ProfileViewController.swift | 4 ++-- .../MastodonCore/Service/API/APIService+Relationship.swift | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Mastodon/Protocol/Provider/DataSourceFacade+Block.swift b/Mastodon/Protocol/Provider/DataSourceFacade+Block.swift index 139de62dc..b5d59ef67 100644 --- a/Mastodon/Protocol/Provider/DataSourceFacade+Block.swift +++ b/Mastodon/Protocol/Provider/DataSourceFacade+Block.swift @@ -27,7 +27,7 @@ extension DataSourceFacade { ) let userInfo = [ - .relationship: response.value, + UserInfoKey.relationship: response.value, ] NotificationCenter.default.post(name: .relationshipChanged, object: self, userInfo: userInfo) diff --git a/Mastodon/Protocol/Provider/DataSourceFacade+Follow.swift b/Mastodon/Protocol/Provider/DataSourceFacade+Follow.swift index b47aa9e76..b024cfa96 100644 --- a/Mastodon/Protocol/Provider/DataSourceFacade+Follow.swift +++ b/Mastodon/Protocol/Provider/DataSourceFacade+Follow.swift @@ -27,7 +27,7 @@ extension DataSourceFacade { dependency.context.authenticationService.fetchFollowingAndBlockedAsync() NotificationCenter.default.post(name: .relationshipChanged, object: nil, userInfo: [ - .relationship: response + UserInfoKey.relationship: response ]) return response @@ -75,7 +75,7 @@ extension DataSourceFacade { } NotificationCenter.default.post(name: .relationshipChanged, object: nil, userInfo: [ - .relationship: newRelationship + UserInfoKey.relationship: newRelationship ]) await notificationView.configure(notification: notification, authenticationBox: dependency.authContext.mastodonAuthenticationBox) @@ -115,7 +115,7 @@ extension DataSourceFacade { ) let userInfo = [ - .relationship: newRelationship, + UserInfoKey.relationship: newRelationship, ] NotificationCenter.default.post(name: .relationshipChanged, object: self, userInfo: userInfo) diff --git a/Mastodon/Protocol/Provider/DataSourceFacade+Mute.swift b/Mastodon/Protocol/Provider/DataSourceFacade+Mute.swift index b072e8e27..11a975381 100644 --- a/Mastodon/Protocol/Provider/DataSourceFacade+Mute.swift +++ b/Mastodon/Protocol/Provider/DataSourceFacade+Mute.swift @@ -23,7 +23,7 @@ extension DataSourceFacade { ) let userInfo = [ - .relationship: response.value, + UserInfoKey.relationship: response.value, ] NotificationCenter.default.post(name: .relationshipChanged, object: self, userInfo: userInfo) diff --git a/Mastodon/Scene/Discovery/ForYou/ProfileCardView+ViewModel.swift b/Mastodon/Scene/Discovery/ForYou/ProfileCardView+ViewModel.swift index e7bf776c7..b67ac9b5d 100644 --- a/Mastodon/Scene/Discovery/ForYou/ProfileCardView+ViewModel.swift +++ b/Mastodon/Scene/Discovery/ForYou/ProfileCardView+ViewModel.swift @@ -57,7 +57,7 @@ extension ProfileCardView.ViewModel { private func bindHeader(view: ProfileCardView) { $authorBannerImageURL .sink { url in - guard let url = url, !url.absoluteString.hasSuffix("missing.png") else { + guard let url = url, !url.absoluteString.hasSuffix(Mastodon.Entity.Account.missingImageName) else { view.bannerImageView.image = .placeholder(color: .systemGray3) return } diff --git a/Mastodon/Scene/Profile/ProfileViewController.swift b/Mastodon/Scene/Profile/ProfileViewController.swift index 09ee2235d..6141014a9 100644 --- a/Mastodon/Scene/Profile/ProfileViewController.swift +++ b/Mastodon/Scene/Profile/ProfileViewController.swift @@ -833,7 +833,7 @@ extension ProfileViewController: ProfileHeaderViewControllerDelegate { // we need to trigger this here as domain block doesn't return a relationship let userInfo = [ - .relationship: newRelationship, + UserInfoKey.relationship: newRelationship, ] NotificationCenter.default.post(name: .relationshipChanged, object: self, userInfo: userInfo) @@ -1002,7 +1002,7 @@ extension ProfileViewController { @objc func relationshipChanged(_ notification: Notification) { - guard let userInfo = notification.userInfo, let relationship = userInfo[.relationship] as? Mastodon.Entity.Relationship else { + guard let userInfo = notification.userInfo, let relationship = userInfo[UserInfoKey.relationship] as? Mastodon.Entity.Relationship else { return } diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Relationship.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Relationship.swift index 69b378cb2..4336aa0a1 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Relationship.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Relationship.swift @@ -15,7 +15,7 @@ extension Notification.Name { public static let relationshipChanged = Notification.Name(rawValue: "org.joinmastodon.app.relationship-changed") } -extension AnyHashable { +public enum UserInfoKey { public static let relationship = "relationship" }