Don't show Follow activity for user's own account
This commit is contained in:
parent
ba3e9e7491
commit
393a134648
|
@ -303,6 +303,16 @@ extension ProfileTableViewController: ProfileHeaderTableViewCellDelegate {
|
||||||
func showMoreOptions(cell: ProfileHeaderTableViewCell) {
|
func showMoreOptions(cell: ProfileHeaderTableViewCell) {
|
||||||
let account = mastodonController.persistentContainer.account(for: accountID)!
|
let account = mastodonController.persistentContainer.account(for: accountID)!
|
||||||
|
|
||||||
|
func showActivityController(activities: [UIActivity]) {
|
||||||
|
let activityController = UIActivityViewController(activityItems: [account.url, AccountActivityItemSource(account)], applicationActivities: activities)
|
||||||
|
activityController.completionWithItemsHandler = OpenInSafariActivity.completionHandler(viewController: self, url: account.url)
|
||||||
|
activityController.popoverPresentationController?.sourceView = cell.moreButtonVisualEffectView
|
||||||
|
self.present(activityController, animated: true)
|
||||||
|
}
|
||||||
|
|
||||||
|
if account.id == mastodonController.account.id {
|
||||||
|
showActivityController(activities: [OpenInSafariActivity()])
|
||||||
|
} else {
|
||||||
let request = Client.getRelationships(accounts: [account.id])
|
let request = Client.getRelationships(accounts: [account.id])
|
||||||
mastodonController.run(request) { (response) in
|
mastodonController.run(request) { (response) in
|
||||||
var customActivities: [UIActivity] = [OpenInSafariActivity()]
|
var customActivities: [UIActivity] = [OpenInSafariActivity()]
|
||||||
|
@ -312,10 +322,8 @@ extension ProfileTableViewController: ProfileHeaderTableViewCellDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
let activityController = UIActivityViewController(activityItems: [account.url, AccountActivityItemSource(account)], applicationActivities: customActivities)
|
showActivityController(activities: customActivities)
|
||||||
activityController.completionWithItemsHandler = OpenInSafariActivity.completionHandler(viewController: self, url: account.url)
|
}
|
||||||
activityController.popoverPresentationController?.sourceView = cell.moreButtonVisualEffectView
|
|
||||||
self.present(activityController, animated: true)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue