Disallow blocking your own domain

This commit is contained in:
Shadowfacts 2024-06-02 11:41:50 -07:00
parent 4dc484c3c2
commit afe47437e4
1 changed files with 2 additions and 1 deletions

View File

@ -561,7 +561,8 @@ extension MenuActionProvider {
UIAction(title: "Cancel", handler: { _ in }),
UIAction(title: "Block \(displayName)", image: image, attributes: .destructive, handler: handler(true)),
]
if mastodonController.instanceFeatures.blockDomains {
if mastodonController.instanceFeatures.blockDomains,
host != mastodonController.account?.url.host {
children.append(UIAction(title: "Block \(host)", image: image, attributes: .destructive, handler: domainHandler(true)))
}
return UIMenu(title: "Block", image: image, children: children)