From a2f88c137052ad07bd402c98dd9b4c7e16cd2cbe Mon Sep 17 00:00:00 2001 From: Akshay S Dinesh Date: Sat, 22 Nov 2014 18:51:16 +0530 Subject: [PATCH 1/2] Improved ordering of 9gag messages. Useful when upload speed is low --- plugins/9gag.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/9gag.lua b/plugins/9gag.lua index f9a812c..444a126 100644 --- a/plugins/9gag.lua +++ b/plugins/9gag.lua @@ -12,12 +12,19 @@ function get_9GAG() return link_image, title end +function send_title(cb_extra, success, result) + --if success then + print("return called") + send_msg(cb_extra[1], cb_extra[2], ok_cb, false) + --end +end + function run(msg, matches) local receiver = get_receiver(msg) url, title = get_9GAG() file_path = download_to_file(url) - send_photo(receiver, file_path, ok_cb, false) - return title + send_photo(receiver, file_path, send_title, {receiver, title}) + return false end return { From 06d9e50e3ecd0e98581cff1be413f3e203fce21b Mon Sep 17 00:00:00 2001 From: Akshay S Dinesh Date: Sat, 22 Nov 2014 18:55:53 +0530 Subject: [PATCH 2/2] fixup of debug --- plugins/9gag.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/9gag.lua b/plugins/9gag.lua index 444a126..a40354f 100644 --- a/plugins/9gag.lua +++ b/plugins/9gag.lua @@ -13,10 +13,9 @@ function get_9GAG() end function send_title(cb_extra, success, result) - --if success then - print("return called") + if success then send_msg(cb_extra[1], cb_extra[2], ok_cb, false) - --end + end end function run(msg, matches)