Fix all profile statuses appearing as pinned on PixelFed
This commit is contained in:
parent
cab78a4aa4
commit
7e90fe2401
|
@ -29,6 +29,10 @@ struct InstanceFeatures {
|
|||
instanceType == .pleroma
|
||||
}
|
||||
|
||||
var profilePinnedStatuses: Bool {
|
||||
instanceType != .pixelfed
|
||||
}
|
||||
|
||||
mutating func update(instance: Instance, nodeInfo: NodeInfo?) {
|
||||
let ver = instance.version.lowercased()
|
||||
if ver.contains("glitch") {
|
||||
|
@ -37,6 +41,8 @@ struct InstanceFeatures {
|
|||
instanceType = .hometown
|
||||
} else if ver.contains("pleroma") {
|
||||
instanceType = .pleroma
|
||||
} else if ver.contains("pixelfed") {
|
||||
instanceType = .pixelfed
|
||||
} else {
|
||||
instanceType = .mastodon
|
||||
}
|
||||
|
@ -51,6 +57,7 @@ extension InstanceFeatures {
|
|||
case pleroma
|
||||
case hometown
|
||||
case glitch
|
||||
case pixelfed
|
||||
|
||||
var isMastodon: Bool {
|
||||
switch self {
|
||||
|
|
|
@ -105,7 +105,8 @@ class ProfileStatusesViewController: DiffableTimelineLikeTableViewController<Pro
|
|||
}
|
||||
|
||||
private func loadPinnedStatuses(snapshot: @escaping () -> Snapshot, completion: @escaping (LoadResult) -> Void) {
|
||||
guard kind == .statuses else {
|
||||
guard kind == .statuses,
|
||||
mastodonController.instanceFeatures.profilePinnedStatuses else {
|
||||
completion(.success(snapshot()))
|
||||
return
|
||||
}
|
||||
|
|
|
@ -163,7 +163,8 @@ extension MenuPreviewProvider {
|
|||
}
|
||||
|
||||
// only allowing pinning user's own statuses
|
||||
if account.id == status.account.id {
|
||||
if account.id == status.account.id,
|
||||
mastodonController.instanceFeatures.profilePinnedStatuses {
|
||||
let pinned = status.pinned ?? false
|
||||
actionsSection.append(createAction(identifier: "pin", title: pinned ? "Unpin from Profile" : "Pin to Profile", systemImageName: pinned ? "pin.slash" : "pin", handler: { [weak self] (_) in
|
||||
guard let self = self else { return }
|
||||
|
|
Loading…
Reference in New Issue