1
0
mirror of https://github.com/mastodon/mastodon-ios.git synced 2024-12-30 10:41:26 +01:00

Remove RelationshipActionOption for reblogs again (#365)

This commit is contained in:
Nathan Mattes 2022-11-07 18:52:02 +01:00
parent 143a9b3294
commit 00ab7ac2b0
2 changed files with 5 additions and 10 deletions

View File

@ -385,7 +385,9 @@ extension ProfileViewController {
]
if let me = self.viewModel?.me, me.following.contains(user) {
menuActions.insert(.hideReblogs(.init(showReblogs: self.viewModel.relationshipViewModel.showReblogs)), at: 1)
let showReblogs = me.showingReblogsBy.contains(user)
let context = MastodonMenu.HideReblogsActionContext(showReblogs: showReblogs)
menuActions.insert(.hideReblogs(context), at: 1)
}
let menu = MastodonMenu.setupMenu(

View File

@ -58,8 +58,6 @@ public struct RelationshipActionOptionSet: OptionSet {
public static let edit = RelationshipAction.edit.option
public static let editing = RelationshipAction.editing.option
public static let updating = RelationshipAction.updating.option
public static let showReblogs = RelationshipAction.showReblogs.option
public static let editOptions: RelationshipActionOptionSet = [.edit, .editing, .updating]
public func highPriorityAction(except: RelationshipActionOptionSet) -> RelationshipAction? {
@ -187,7 +185,7 @@ extension RelationshipViewModel {
self.isBlockingBy = optionSet.contains(.blockingBy)
self.isBlocking = optionSet.contains(.blocking)
self.isSuspended = optionSet.contains(.suspended)
self.showReblogs = optionSet.contains(.showReblogs)
self.showReblogs = me.showingReblogsBy.contains(user)
self.optionSet = optionSet
}
@ -219,8 +217,7 @@ extension RelationshipViewModel {
let isMuting = user.mutingBy.contains(me)
let isBlockingBy = me.blockingBy.contains(user)
let isBlocking = user.blockingBy.contains(me)
let isShowingReblogs = me.showingReblogsBy.contains(user)
var optionSet: RelationshipActionOptionSet = [.follow]
if isMyself {
@ -259,10 +256,6 @@ extension RelationshipViewModel {
optionSet.insert(.suspended)
}
if isShowingReblogs {
optionSet.insert(.showReblogs)
}
return optionSet
}
}