From 39010eff6bc5b783235a9cb6afa901f552a559fe Mon Sep 17 00:00:00 2001 From: Jeena Paradies Date: Sat, 3 Nov 2012 05:34:15 +0100 Subject: [PATCH] fixed #4 --- Appcast.xml | 4 ++-- Controller.m | 4 +++- Core.js | 5 ++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Appcast.xml b/Appcast.xml index b74ddcb..9060b46 100755 --- a/Appcast.xml +++ b/Appcast.xml @@ -9,12 +9,12 @@ Version 0.1.1 10.5.0 http://jabs.nu/Tentia/download/ReleaseNotes.html - Sat, 03 Nov 2012 03:16:09 +0100 + Sat, 03 Nov 2012 03:21:16 +0100 + sparkle:dsaSignature="MCwCFHtN6ajYp972vjGx2JGi8b/a5u6GAhRbVbHvROeCyt59OAbDfy0nNBan/A==" /> diff --git a/Controller.m b/Controller.m index b04af1b..0a750e4 100644 --- a/Controller.m +++ b/Controller.m @@ -215,10 +215,12 @@ - (IBAction)sendTweet:(id)sender { TweetModel *tweet = (TweetModel *)[sender object]; + NSString *text = [[tweet.text stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""] stringByReplacingOccurrencesOfString:@"\\" withString:@"\\\\"]; NSString *func = [NSString stringWithFormat:@"tentia_instance.sendNewMessage(\"%@\", \"%@\", \"%@\")", - [tweet.text stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""], + text, tweet.inReplyTostatusId, tweet.inReplyToEntity]; + NSLog(@"%@", func); [timelineView stringByEvaluatingJavaScriptFromString:func]; } diff --git a/Core.js b/Core.js index d455a7b..06826f5 100644 --- a/Core.js +++ b/Core.js @@ -261,13 +261,14 @@ Core.prototype.getNewData = function() { Core.prototype.sendNewMessage = function(content, in_reply_to_status_id, in_reply_to_entity) { + debug(content) var _this = this; var url = URI(mkApiRootPath("/posts")); var http_method = "POST"; - var callback = function(data) { _this.getNewData(true); } + var callback = function(data) { _this.getNewData(); } var data = { "type": "https://tent.io/types/post/status/v0.1.0", @@ -285,6 +286,8 @@ Core.prototype.sendNewMessage = function(content, in_reply_to_status_id, in_repl data["mentions"] = mentions; } + debug(JSON.stringify(data)) + getURL(url.toString(), http_method, callback, JSON.stringify(data)); // FIXME: error callback }