Commit d0dde8d7 authored by Aral Balkan's avatar Aral Balkan
Browse files

Attachments appearing correctly in timelines again.

parent 3256ace5
......@@ -62,7 +62,7 @@ class MessageSplitViewController: NSSplitViewController
//
if CurrentTimeline.relativeWebPrefix == nil
{
fatalError("Could not get relative web prefix for current timeline — not implemented. Only Private, All Friends, and Public timlines implemented at the moment.")
fatalError("Could not get relative web prefix for current timeline — not implemented. Only Private, All Friends, and Public timelines implemented at the moment.")
}
println("Current timeline relative web prefix: \(CurrentTimeline.relativeWebPrefix)")
......@@ -78,6 +78,8 @@ class MessageSplitViewController: NSSplitViewController
// This is the URL that will be prefixed to all assets in the HTML (images, etc.)
let assetURLPrefix = CurrentTimeline.relativeWebPrefix!.stringByAppendingPathComponent(messageFileName)
println("Asset URL Prefix: \(assetURLPrefix)")
println("Message file name: \(messageFileName)")
let filePath = NSHomeDirectory().stringByAppendingPathComponent("Pulse/Sync").stringByAppendingPathComponent(CurrentTimeline.path!).stringByAppendingPathComponent(messageFileName)
......@@ -105,6 +107,8 @@ class MessageSplitViewController: NSSplitViewController
// Massage the HTML.
//
println(indexHTML)
// Fix image URLs
indexHTML = indexHTML.stringByReplacingOccurrencesOfString("file:///", withString: assetURLPrefix.stringByAppendingString("/"))
......
......@@ -361,9 +361,9 @@ class TimelineViewController: NSViewController
// WKWebKit cannot load local files from the container (bug/major limitation)
// So we have to load it via a private (127.0.0.1 only) web server.
messageHTML = messageHTML.stringByReplacingOccurrencesOfString("src=\"", withString: "src=\"http://127.0.0.1:42003/message/")
messageHTML = messageHTML.stringByReplacingOccurrencesOfString("src=\"", withString: "src=\"http://127.0.0.1:42003")
messageHTML = messageHTML.stringByReplacingOccurrencesOfString("\"", withString: "\\\"")
// messageHTML = messageHTML.stringByReplacingOccurrencesOfString("\"", withString: "\\\"")
// Create the message object (with metadata, etc.)
// let message = ["id": , "html":messageHTML, ]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment