Continue work on send to Micro.blog.

This commit is contained in:
Brent Simmons 2018-01-10 14:00:06 -08:00
parent 790a6f6d2d
commit 32dae64b83

View File

@ -24,13 +24,7 @@ final class SendToMicroBlogCommand: SendToCommand {
func canSendObject(_ object: Any?, selectedText: String?) -> Bool {
guard appExists else {
return false
}
guard let article = object as? Article else {
return false
}
guard let _ = article.preferredLink else {
guard appExists, let article = object as? Article, let _ = article.preferredLink else {
return false
}
@ -60,6 +54,9 @@ final class SendToMicroBlogCommand: SendToCommand {
s = "[" + s + "](" + link + ")"
}
}
else if let link = article.preferredLink {
s = link
}
guard let encodedString = s.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) else {
return