forked from shadowfacts/Tusker
parent
f8de6f9e10
commit
bf87ae7a7d
|
@ -69,6 +69,19 @@ extension MenuActionProvider {
|
|||
if let ownAccount = mastodonController.account,
|
||||
accountID != ownAccount.id {
|
||||
actionsSection.append(relationshipAction(accountID: accountID, mastodonController: mastodonController, builder: { [unowned self] in self.followAction(for: $0, mastodonController: $1) }))
|
||||
actionsSection.append(UIDeferredMenuElement.uncached({ elementHandler in
|
||||
let listActions = mastodonController.lists.map { list in
|
||||
UIAction(title: list.title, image: UIImage(systemName: "plus")) { [unowned self] _ in
|
||||
let req = List.add(list, accounts: [accountID])
|
||||
mastodonController.run(req) { response in
|
||||
if case .failure(let error) = response {
|
||||
self.handleError(error, title: "Error Adding to List")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elementHandler([UIMenu(title: "Add to List", image: UIImage(systemName: "list.bullet"), children: listActions)])
|
||||
}))
|
||||
suppressSection.append(relationshipAction(accountID: accountID, mastodonController: mastodonController, builder: { [unowned self] in self.blockAction(for: $0, mastodonController: $1) }))
|
||||
suppressSection.append(relationshipAction(accountID: accountID, mastodonController: mastodonController, builder: { [unowned self] in self.muteAction(for: $0, mastodonController: $1) }))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue