forked from shadowfacts/Tusker
Disallow blocking your own domain
This commit is contained in:
parent
4dc484c3c2
commit
afe47437e4
|
@ -561,7 +561,8 @@ extension MenuActionProvider {
|
||||||
UIAction(title: "Cancel", handler: { _ in }),
|
UIAction(title: "Cancel", handler: { _ in }),
|
||||||
UIAction(title: "Block \(displayName)", image: image, attributes: .destructive, handler: handler(true)),
|
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)))
|
children.append(UIAction(title: "Block \(host)", image: image, attributes: .destructive, handler: domainHandler(true)))
|
||||||
}
|
}
|
||||||
return UIMenu(title: "Block", image: image, children: children)
|
return UIMenu(title: "Block", image: image, children: children)
|
||||||
|
|
Loading…
Reference in New Issue