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
1 changed files with 4 additions and 7 deletions

View File

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