mastodon-ios/Mastodon/Protocol/Provider/DataSourceFacade+Mute.swift

26 lines
690 B
Swift
Raw Normal View History

//
// DataSourceFacade+Mute.swift
// Mastodon
//
// Created by MainasuK on 2022-1-24.
//
import UIKit
import CoreDataStack
2022-10-08 07:43:06 +02:00
import MastodonCore
extension DataSourceFacade {
static func responseToUserMuteAction(
dependency: NeedsDependency & AuthContextProvider,
user: ManagedObjectRecord<MastodonUser>
) async throws {
let selectionFeedbackGenerator = await UISelectionFeedbackGenerator()
await selectionFeedbackGenerator.selectionChanged()
_ = try await dependency.context.apiService.toggleMute(
user: user,
authenticationBox: dependency.authContext.mastodonAuthenticationBox
)
} // end func
}