diff --git a/Pachyderm/Model/Status.swift b/Pachyderm/Model/Status.swift index 734e8ad1..6e01199f 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 1b91a98e..cdbd41d1 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 76f21030..b6252667 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 035423e0..3d9e5e53 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 3469b789..cddaf959 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 421c3a3e..8790ae56 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)