From f91ca7d6508b16f8a7771efa7ed28632c53be928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Sat, 27 Oct 2012 11:45:26 +0200 Subject: [PATCH 1/5] added short description to the server section [ci skip] --- config/diaspora.yml.example | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/diaspora.yml.example b/config/diaspora.yml.example index 0f71bfffa..b9b241c5e 100644 --- a/config/diaspora.yml.example +++ b/config/diaspora.yml.example @@ -99,7 +99,8 @@ configuration: ## Section ## Diaspora is only tested against this default pubsub server. ## You likely don't want to change this. #pubsub_server: 'https://pubsubhubbub.appspot.com/' - + + ## Settings affecting how ./script/server behaves. server: ## Section ## The port on which the appserver should listen #port: 3000 From e943a1cab65c5ec4944a9ea232f05e6abc53e9ff Mon Sep 17 00:00:00 2001 From: movilla Date: Wed, 31 Oct 2012 23:31:24 +0100 Subject: [PATCH 2/5] Fix overflow button in mobile reset password --- Changelog.md | 1 + app/assets/stylesheets/mobile.css.scss | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Changelog.md b/Changelog.md index 2d7e6f59a..532b234d1 100644 --- a/Changelog.md +++ b/Changelog.md @@ -23,6 +23,7 @@ ## Bug Fixes +* Fix overflow button in mobile reset password. [#3696](https://github.com/diaspora/diaspora/pull/3696) * Fix issue with interacted_at in post fetcher. [#3607](https://github.com/diaspora/diaspora/pull/3607) * Fix error with show post Community Spotlight. [#3658](https://github.com/diaspora/diaspora/pull/3658) * Fix javascripts problem with read/unread notifications. [#3656](https://github.com/diaspora/diaspora/pull/3656) diff --git a/app/assets/stylesheets/mobile.css.scss b/app/assets/stylesheets/mobile.css.scss index 0e536122d..0fb00d5ff 100644 --- a/app/assets/stylesheets/mobile.css.scss +++ b/app/assets/stylesheets/mobile.css.scss @@ -781,3 +781,8 @@ textarea#conversation_text { color: #DF0101; text-shadow: 1px 1px 5px #666; } + +form#new_user.new_user input.btn { + white-space: normal; +} + From 86ca3a36fb75180230a03c3c34a7d0b51c70225d Mon Sep 17 00:00:00 2001 From: movilla Date: Wed, 31 Oct 2012 23:36:25 +0100 Subject: [PATCH 3/5] Add Changelog --- Changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 532b234d1..91e9711be 100644 --- a/Changelog.md +++ b/Changelog.md @@ -23,7 +23,7 @@ ## Bug Fixes -* Fix overflow button in mobile reset password. [#3696](https://github.com/diaspora/diaspora/pull/3696) +* Fix overflow button in mobile reset password. [#3697](https://github.com/diaspora/diaspora/pull/3697) * Fix issue with interacted_at in post fetcher. [#3607](https://github.com/diaspora/diaspora/pull/3607) * Fix error with show post Community Spotlight. [#3658](https://github.com/diaspora/diaspora/pull/3658) * Fix javascripts problem with read/unread notifications. [#3656](https://github.com/diaspora/diaspora/pull/3656) From b96fbb0676442df2f0d953925480d3f1dd341232 Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Tue, 30 Oct 2012 23:09:24 +0200 Subject: [PATCH 4/5] Fix empty page after callback from service by redirecting to origin. Also make settings/services page use the same window when authenticating with other services instead of launching a popup. --- Changelog.md | 1 + app/controllers/services_controller.rb | 8 ++++++-- app/views/shared/_add_remove_services.haml | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Changelog.md b/Changelog.md index 91e9711be..baf62dbf2 100644 --- a/Changelog.md +++ b/Changelog.md @@ -30,6 +30,7 @@ * Fix error with open/close registrations. [#3649](https://github.com/diaspora/diaspora/pull/3649) * Fix javascripts error in invitations facebox. [#3638](https://github.com/diaspora/diaspora/pull/3638) * Fix css overflow problem in aspect dropdown on welcome page. [#3637](https://github.com/diaspora/diaspora/pull/3637) +* Fix empty page after authenticating with other services. [#3693](https://github.com/diaspora/diaspora/pull/3693) # 0.0.1.2 diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index 6257e0455..2ff6c3717 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -48,8 +48,12 @@ class ServicesController < ApplicationController :service_name => provider.camelize ) end end - - render :text => ("") + + if request.env['omniauth.origin'].nil? + render :text => ("") + else + redirect_to request.env['omniauth.origin'] + end end def failure diff --git a/app/views/shared/_add_remove_services.haml b/app/views/shared/_add_remove_services.haml index 4c3c97577..d44d892ca 100644 --- a/app/views/shared/_add_remove_services.haml +++ b/app/views/shared/_add_remove_services.haml @@ -16,4 +16,4 @@ - AppConfig.configured_services.each do |service| - unless @services.any?{|x| x.provider == service} - %h4= link_to t("services.index.connect_to_#{service}"), "#", :onclick => "window.open('/auth/#{service}', 'popup', 'height=400,width=500')" + %h4= link_to(t("services.index.connect_to_#{service}"), "/auth/#{service}") From e974d2934fb8000f521fec06eac6a0f95d350706 Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Thu, 1 Nov 2012 23:21:22 +0200 Subject: [PATCH 5/5] Always use basic Facebook Graph API to post messages, fixes public posts. Remove unnecessary Facebook opengraph config items --- Changelog.md | 1 + app/models/services/facebook.rb | 10 +--------- config/defaults.yml | 1 - config/diaspora.yml.example | 3 --- spec/models/services/facebook_spec.rb | 6 +++--- 5 files changed, 5 insertions(+), 16 deletions(-) diff --git a/Changelog.md b/Changelog.md index baf62dbf2..86cf393af 100644 --- a/Changelog.md +++ b/Changelog.md @@ -31,6 +31,7 @@ * Fix javascripts error in invitations facebox. [#3638](https://github.com/diaspora/diaspora/pull/3638) * Fix css overflow problem in aspect dropdown on welcome page. [#3637](https://github.com/diaspora/diaspora/pull/3637) * Fix empty page after authenticating with other services. [#3693](https://github.com/diaspora/diaspora/pull/3693) +* Fix posting public posts to Facebook. [#2882](https://github.com/diaspora/diaspora/issues/2882), [#3650](https://github.com/diaspora/diaspora/issues/3650) # 0.0.1.2 diff --git a/app/models/services/facebook.rb b/app/models/services/facebook.rb index 39d2b1086..45ee65817 100644 --- a/app/models/services/facebook.rb +++ b/app/models/services/facebook.rb @@ -11,21 +11,13 @@ class Services::Facebook < Service def post(post, url='') Rails.logger.debug("event=post_to_service type=facebook sender_id=#{self.user_id}") - if post.public? - post_to_facebook("https://graph.facebook.com/me/joindiaspora:make", create_open_graph_params(post).to_param) - else - post_to_facebook("https://graph.facebook.com/me/feed", create_post_params(post).to_param) - end + post_to_facebook("https://graph.facebook.com/me/feed", create_post_params(post).to_param) end def post_to_facebook(url, body) Faraday.post(url, body) end - def create_open_graph_params(post) - {:post => "#{AppConfig.pod_uri.to_s}#{short_post_path(post)}", :access_token => self.access_token} - end - def create_post_params(post) message = post.text(:plain_text => true) {:message => message, :access_token => self.access_token, :link => URI.extract(message, ['https', 'http']).first} diff --git a/config/defaults.yml b/config/defaults.yml index fffeeb1a9..169edaa7e 100644 --- a/config/defaults.yml +++ b/config/defaults.yml @@ -56,7 +56,6 @@ defaults: enable: false app_id: secret: - open_graph_namespace: 'joindiaspora' twitter: enable: false key: diff --git a/config/diaspora.yml.example b/config/diaspora.yml.example index b9b241c5e..1932a7a6e 100644 --- a/config/diaspora.yml.example +++ b/config/diaspora.yml.example @@ -252,9 +252,6 @@ configuration: ## Section #enable: true #app_id: 'abcdef' #secret: 'changeme' - ## this will be the namespace for your object, - ## it should be configured in your FB app - #open_graph_namespace: ## OAuth credentials for Twitter: twitter: ## Section diff --git a/spec/models/services/facebook_spec.rb b/spec/models/services/facebook_spec.rb index 792c4df96..f401b83a5 100644 --- a/spec/models/services/facebook_spec.rb +++ b/spec/models/services/facebook_spec.rb @@ -11,7 +11,7 @@ describe Services::Facebook do describe '#post' do it 'posts a status message to facebook' do - stub_request(:post, "https://graph.facebook.com/me/joindiaspora:make"). + stub_request(:post, "https://graph.facebook.com/me/feed"). to_return(:status => 200, :body => "", :headers => {}) @service.post(@post) end @@ -19,13 +19,13 @@ describe Services::Facebook do it 'swallows exception raised by facebook always being down' do pending "temporarily disabled to figure out while some requests are failing" - stub_request(:post,"https://graph.facebook.com/me/joindiaspora:make"). + stub_request(:post,"https://graph.facebook.com/me/feed"). to_raise(StandardError) @service.post(@post) end it 'should call public message' do - stub_request(:post, "https://graph.facebook.com/me/joindiaspora:make"). + stub_request(:post, "https://graph.facebook.com/me/feed"). to_return(:status => 200) url = "foo" @service.should_not_receive(:public_message)