Add context menu for follow notifications

This commit is contained in:
Shadowfacts 2019-09-06 17:59:57 -04:00
parent 8723921cec
commit 49380692f3
Signed by untrusted user: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 17 additions and 0 deletions

View File

@ -130,3 +130,20 @@ class FollowNotificationGroupTableViewCell: UITableViewCell {
}
}
extension FollowNotificationGroupTableViewCell: MenuPreviewProvider {
func getPreviewProviders(for location: CGPoint, sourceViewController: UIViewController) -> PreviewProviders? {
return (content: {
let accountIDs = self.group.notificationIDs.compactMap(MastodonCache.notification(for:)).map { $0.account.id }
if accountIDs.count == 1 {
return ProfileTableViewController(accountID: accountIDs.first!)
} else {
return AccountListTableViewController(accountIDs: accountIDs)
}
}, actions: {
return self.actionsForNotificationGroup(self.group)
})
}
}