From b25c419e527454a8881ad0ad7e8be00bb342ec0f Mon Sep 17 00:00:00 2001 From: nilsding Date: Fri, 12 Dec 2014 23:53:23 +0100 Subject: [PATCH] aw yeah --- app/controllers/ajax/inbox_controller.rb | 10 ++++++---- app/models/services/twitter.rb | 6 ++++-- config/justask.yml.example | 3 +++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/controllers/ajax/inbox_controller.rb b/app/controllers/ajax/inbox_controller.rb index a8c33547..90bb36ff 100644 --- a/app/controllers/ajax/inbox_controller.rb +++ b/app/controllers/ajax/inbox_controller.rb @@ -34,10 +34,10 @@ class Ajax::InboxController < ApplicationController return end - a = nil + answer = nil begin - a = inbox.answer params[:answer], current_user + answer = inbox.answer params[:answer], current_user rescue @status = :err @message = "An error occurred" @@ -45,8 +45,10 @@ class Ajax::InboxController < ApplicationController return end - current_user.services.each do |service| - service.post a + Thread.new do + current_user.services.each do |service| + service.post answer + end end @status = :okay diff --git a/app/models/services/twitter.rb b/app/models/services/twitter.rb index bb47815c..69cb0d66 100644 --- a/app/models/services/twitter.rb +++ b/app/models/services/twitter.rb @@ -31,10 +31,12 @@ class Services::Twitter < Service answer_content = answer.content answer_url = show_user_answer_url( id: answer.id, - username: answer.user.screen_name + username: answer.user.screen_name, + host: APP_CONFIG['hostname'], + protocol: (APP_CONFIG['https'] ? :https : :http) ) Rails.logger.debug "answer_url => #{answer_url}" "#{question_content[0..55]}#{'…' if question_content.length > 56}" \ - " — #{answer_content[0..55]}#{'…' if answercontent.length > 56} #{answer_url}" + " — #{answer_content[0..55]}#{'…' if answer_content.length > 56} #{answer_url}" end end \ No newline at end of file diff --git a/config/justask.yml.example b/config/justask.yml.example index 7565421c..e596e92e 100644 --- a/config/justask.yml.example +++ b/config/justask.yml.example @@ -1,6 +1,9 @@ # The site name, shown everywhere. site_name: "justask" +hostname: "justask.rrerr.net" +https: true + # Name of the "Anonymous" user. (e.g. "Anonymous Coward", "Arno Nym", "Mr. X", ...) anonymous_name: "Anonymous"