From d4bf2897160c2db2915e84b38537c1de096ecc86 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Thu, 14 May 2020 21:57:00 -0400 Subject: [PATCH] Fx more actions not workign --- Pachyderm/Model/Status.swift | 20 +++++++++---------- .../Account Activities/AccountActivity.swift | 7 +++---- .../BookmarkStatusActivity.swift | 2 +- .../Status Activities/PinStatusActivity.swift | 2 +- .../Status Activities/StatusActivity.swift | 7 +++---- .../UnpinStatusActivity.swift | 2 +- 6 files changed, 19 insertions(+), 21 deletions(-) diff --git a/Pachyderm/Model/Status.swift b/Pachyderm/Model/Status.swift index 734e8ad182..6e01199f66 100644 --- a/Pachyderm/Model/Status.swift +++ b/Pachyderm/Model/Status.swift @@ -80,28 +80,28 @@ public final class Status: /*StatusProtocol,*/ Decodable { return Request(method: .post, path: "/api/v1/statuses/\(statusID)/unfavourite") } - public static func pin(_ status: Status) -> Request { - return Request(method: .post, path: "/api/v1/statuses/\(status.id)/pin") + public static func pin(_ statusID: String) -> Request { + return Request(method: .post, path: "/api/v1/statuses/\(statusID)/pin") } - public static func unpin(_ status: Status) -> Request { - return Request(method: .post, path: "/api/v1/statuses/\(status.id)/unpin") + public static func unpin(_ statusID: String) -> Request { + return Request(method: .post, path: "/api/v1/statuses/\(statusID)/unpin") } - public static func bookmark(_ status: Status) -> Request { - return Request(method: .post, path: "/api/v1/statuses/\(status.id)/bookmark") + public static func bookmark(_ statusID: String) -> Request { + return Request(method: .post, path: "/api/v1/statuses/\(statusID)/bookmark") } public static func unbookmark(_ statusID: String) -> Request { return Request(method: .post, path: "/api/v1/statuses/\(statusID)/unbookmark") } - public static func muteConversation(_ status: Status) -> Request { - return Request(method: .post, path: "/api/v1/statuses/\(status.id)/mute") + public static func muteConversation(_ statusID: String) -> Request { + return Request(method: .post, path: "/api/v1/statuses/\(statusID)/mute") } - public static func unmuteConversation(_ status: Status) -> Request { - return Request(method: .post, path: "/api/v1/statuses/\(status.id)/unmute") + public static func unmuteConversation(_ statusID: String) -> Request { + return Request(method: .post, path: "/api/v1/statuses/\(statusID)/unmute") } private enum CodingKeys: String, CodingKey { diff --git a/Tusker/Activities/Account Activities/AccountActivity.swift b/Tusker/Activities/Account Activities/AccountActivity.swift index 1b91a98ecc..cdbd41d13f 100644 --- a/Tusker/Activities/Account Activities/AccountActivity.swift +++ b/Tusker/Activities/Account Activities/AccountActivity.swift @@ -7,7 +7,6 @@ // import UIKit -import Pachyderm class AccountActivity: MastodonActivity { @@ -15,17 +14,17 @@ class AccountActivity: MastodonActivity { return .action } - var account: Account? + var account: AccountMO? override func canPerform(withActivityItems activityItems: [Any]) -> Bool { - for case is Account in activityItems { + for case is AccountMO in activityItems { return true } return false } override func prepare(withActivityItems activityItems: [Any]) { - for case let account as Account in activityItems { + for case let account as AccountMO in activityItems { self.account = account return } diff --git a/Tusker/Activities/Status Activities/BookmarkStatusActivity.swift b/Tusker/Activities/Status Activities/BookmarkStatusActivity.swift index 76f2103024..b6252667f8 100644 --- a/Tusker/Activities/Status Activities/BookmarkStatusActivity.swift +++ b/Tusker/Activities/Status Activities/BookmarkStatusActivity.swift @@ -26,7 +26,7 @@ class BookmarkStatusActivity: StatusActivity { override func perform() { guard let status = status else { return } - let request = Status.bookmark(status) + let request = Status.bookmark(status.id) mastodonController.run(request) { (response) in if case let .success(status, _) = response { self.mastodonController.persistentContainer.addOrUpdate(status: status, incrementReferenceCount: false) diff --git a/Tusker/Activities/Status Activities/PinStatusActivity.swift b/Tusker/Activities/Status Activities/PinStatusActivity.swift index 035423e035..3d9e5e53d3 100644 --- a/Tusker/Activities/Status Activities/PinStatusActivity.swift +++ b/Tusker/Activities/Status Activities/PinStatusActivity.swift @@ -25,7 +25,7 @@ class PinStatusActivity: StatusActivity { override func perform() { guard let status = status else { return } - let request = Status.pin(status) + let request = Status.pin(status.id) mastodonController.run(request) { (response) in if case let .success(status, _) = response { self.mastodonController.persistentContainer.addOrUpdate(status: status, incrementReferenceCount: false) diff --git a/Tusker/Activities/Status Activities/StatusActivity.swift b/Tusker/Activities/Status Activities/StatusActivity.swift index 3469b78922..cddaf959b3 100644 --- a/Tusker/Activities/Status Activities/StatusActivity.swift +++ b/Tusker/Activities/Status Activities/StatusActivity.swift @@ -7,7 +7,6 @@ // import UIKit -import Pachyderm class StatusActivity: MastodonActivity { @@ -15,17 +14,17 @@ class StatusActivity: MastodonActivity { return .action } - var status: Status? + var status: StatusMO? override func canPerform(withActivityItems activityItems: [Any]) -> Bool { - for case is Status in activityItems { + for case is StatusMO in activityItems { return true } return false } override func prepare(withActivityItems activityItems: [Any]) { - for case let status as Status in activityItems { + for case let status as StatusMO in activityItems { self.status = status return } diff --git a/Tusker/Activities/Status Activities/UnpinStatusActivity.swift b/Tusker/Activities/Status Activities/UnpinStatusActivity.swift index 421c3a3ed5..8790ae5645 100644 --- a/Tusker/Activities/Status Activities/UnpinStatusActivity.swift +++ b/Tusker/Activities/Status Activities/UnpinStatusActivity.swift @@ -25,7 +25,7 @@ class UnpinStatusActivity: StatusActivity { override func perform() { guard let status = status else { return } - let request = Status.unpin(status) + let request = Status.unpin(status.id) mastodonController.run(request) { (response) in if case let .success(status, _) = response { self.mastodonController.persistentContainer.addOrUpdate(status: status, incrementReferenceCount: false)