Disable reblog button for private posts
This commit is contained in:
parent
39e847bda8
commit
848022ec6e
|
@ -141,6 +141,18 @@ class BaseStatusTableViewCell: UITableViewCell {
|
||||||
contentWarningLabel.setEmojis(status.emojis, identifier: statusID)
|
contentWarningLabel.setEmojis(status.emojis, identifier: statusID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let reblogDisabled: Bool
|
||||||
|
switch mastodonController.instance.instanceType {
|
||||||
|
case .mastodon:
|
||||||
|
reblogDisabled = status.visibility == .private || status.visibility == .direct
|
||||||
|
case .pleroma:
|
||||||
|
// Pleroma allows 'Boost to original audience' for your own private posts
|
||||||
|
reblogDisabled = status.visibility == .direct || (status.visibility == .private && status.account.id != mastodonController.account.id)
|
||||||
|
}
|
||||||
|
reblogButton.isEnabled = !reblogDisabled
|
||||||
|
let reblogButtonImage = reblogDisabled ? UIImage(systemName: status.visibility.imageName) : UIImage(systemName: "repeat")
|
||||||
|
reblogButton.setImage(reblogButtonImage, for: .normal)
|
||||||
|
|
||||||
if state.unknown {
|
if state.unknown {
|
||||||
collapsible = !status.spoilerText.isEmpty
|
collapsible = !status.spoilerText.isEmpty
|
||||||
var shouldCollapse = collapsible
|
var shouldCollapse = collapsible
|
||||||
|
|
Loading…
Reference in New Issue