Merge pull request #556 from nossipova/519-toot-menu

Remove mute/block/report from menu for own toots
This commit is contained in:
Marcus Kida 2022-11-15 07:44:58 +01:00 committed by GitHub
commit 92ab45f650
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 14 deletions

View File

@ -152,25 +152,30 @@ extension StatusAuthorView {
}
public func setupAuthorMenu(menuContext: AuthorMenuContext) -> (UIMenu, [UIAccessibilityCustomAction]) {
var actions: [MastodonMenu.Action] = []
var actions = [MastodonMenu.Action]()
actions = [
.muteUser(.init(
name: menuContext.name,
isMuting: menuContext.isMuting
)),
.blockUser(.init(
name: menuContext.name,
isBlocking: menuContext.isBlocking
)),
.reportUser(
.init(name: menuContext.name)
),
if !menuContext.isMyself {
actions.append(contentsOf: [
.muteUser(.init(
name: menuContext.name,
isMuting: menuContext.isMuting
)),
.blockUser(.init(
name: menuContext.name,
isBlocking: menuContext.isBlocking
)),
.reportUser(
.init(name: menuContext.name)
)
])
}
actions.append(contentsOf: [
.bookmarkStatus(
.init(isBookmarking: menuContext.isBookmarking)
),
.shareStatus
]
])
if menuContext.isMyself {
actions.append(.deleteStatus)