Commit ad52eaf6 authored by Dennis Schubert's avatar Dennis Schubert

Merge branch 'stable' into develop

parents 67de83f3 97153ad0
......@@ -60,6 +60,7 @@ Ruby 2.0 is no longer officially supported.
* Make used post title lengths more consistent [#6022](https://github.com/diaspora/diaspora/pull/6022)
* Improved logging source [#6041](https://github.com/diaspora/diaspora/pull/6041)
* Gracefully handle duplicate entry while receiving share-visibility in parallel [#6068](https://github.com/diaspora/diaspora/pull/6068)
* Update twitter gem to get rid of deprecation warnings [#6083](https://github.com/diaspora/diaspora/pull/6083)
## Bug fixes
* Disable auto follow back on aspect deletion [#5846](https://github.com/diaspora/diaspora/pull/5846)
......
......@@ -142,7 +142,7 @@ gem "omniauth", "1.2.2"
gem "omniauth-facebook", "2.0.1"
gem "omniauth-tumblr", "1.1"
gem "omniauth-twitter", "1.2.0"
gem "twitter", "4.8.1"
gem "twitter", "5.14.0"
gem "omniauth-wordpress", "0.2.2"
# Serializers
......
......@@ -73,6 +73,7 @@ GEM
bootstrap-sass (3.3.4.1)
autoprefixer-rails (>= 5.0.0.1)
sass (>= 3.2.19)
buftok (0.2.0)
builder (3.2.2)
byebug (4.0.5)
columnize (= 0.9.0)
......@@ -172,6 +173,7 @@ GEM
hiredis (~> 0.5.0)
entypo-rails (2.2.3)
railties (>= 3.1, <= 5)
equalizer (0.0.11)
erubis (2.7.0)
ethon (0.7.3)
ffi (>= 1.3.0)
......@@ -349,6 +351,8 @@ GEM
hike (1.2.3)
hiredis (0.5.2)
hitimes (1.2.2)
http (0.6.4)
http_parser.rb (~> 0.6.0)
http-cookie (1.0.2)
domain_name (~> 0.5)
http_accept_language (2.0.5)
......@@ -410,6 +414,8 @@ GEM
mime-types (>= 1.16, < 3)
markerb (1.0.2)
redcarpet (>= 2.0)
memoizable (0.4.2)
thread_safe (~> 0.3, >= 0.3.1)
messagebus_ruby_api (1.0.3)
method_source (0.8.2)
mime-types (2.5)
......@@ -424,6 +430,7 @@ GEM
multi_xml (0.5.5)
multipart-post (2.0.0)
mysql2 (0.3.18)
naught (1.0.0)
nenv (0.2.0)
nested_form (0.3.2)
net-scp (1.2.1)
......@@ -696,10 +703,17 @@ GEM
timecop (0.7.3)
timers (4.0.1)
hitimes
twitter (4.8.1)
faraday (~> 0.8, < 0.10)
multi_json (~> 1.0)
simple_oauth (~> 0.2)
twitter (5.14.0)
addressable (~> 2.3)
buftok (~> 0.2.0)
equalizer (~> 0.0.9)
faraday (~> 0.9.0)
http (~> 0.6.0)
http_parser.rb (~> 0.6.0)
json (~> 1.8)
memoizable (~> 0.4.0)
naught (~> 1.0)
simple_oauth (~> 0.3.0)
twitter-text (1.12.0)
unf (~> 0.1.0)
typhoeus (0.7.1)
......@@ -854,7 +868,7 @@ DEPENDENCIES
spring-commands-rspec (= 1.0.4)
test_after_commit (= 0.4.1)
timecop (= 0.7.3)
twitter (= 4.8.1)
twitter (= 5.14.0)
twitter-text (= 1.12.0)
typhoeus (= 0.7.1)
uglifier (= 2.7.1)
......
......@@ -30,10 +30,12 @@ class Services::Twitter < Service
private
def client
@client ||= Twitter::Client.new(
oauth_token: self.access_token,
oauth_token_secret: self.access_secret
)
@client ||= Twitter::REST::Client.new do |config|
config.consumer_key = AppConfig.services.twitter.key
config.consumer_secret = AppConfig.services.twitter.secret
config.access_token = access_token
config.access_token_secret = access_secret
end
end
def attempt_post post, retry_count=0
......
......@@ -5,16 +5,12 @@
Rails.application.config.middleware.use OmniAuth::Builder do
if AppConfig.services.twitter.enable?
provider :twitter, AppConfig.services.twitter.key, AppConfig.services.twitter.secret
Twitter.configure do |config|
config.consumer_key = AppConfig.services.twitter.key
config.consumer_secret = AppConfig.services.twitter.secret
end
end
if AppConfig.services.tumblr.enable?
provider :tumblr, AppConfig.services.tumblr.key, AppConfig.services.tumblr.secret
end
if AppConfig.services.facebook.enable?
provider :facebook, AppConfig.services.facebook.app_id, AppConfig.services.facebook.secret, {
display: "popup",
......@@ -24,9 +20,9 @@ Rails.application.config.middleware.use OmniAuth::Builder do
ca_file: AppConfig.environment.certificate_authorities
}
}
}
}
end
if AppConfig.services.wordpress.enable?
provider :wordpress, AppConfig.services.wordpress.client_id, AppConfig.services.wordpress.secret
end
......
......@@ -12,11 +12,11 @@ describe Services::Twitter, :type => :model do
describe '#post' do
before do
allow_any_instance_of(Twitter::Client).to receive(:update) { Twitter::Tweet.new(id: "1234") }
allow_any_instance_of(Twitter::REST::Client).to receive(:update) { Twitter::Tweet.new(id: "1234") }
end
it 'posts a status message to twitter' do
expect_any_instance_of(Twitter::Client).to receive(:update).with(instance_of(String))
expect_any_instance_of(Twitter::REST::Client).to receive(:update).with(instance_of(String))
@service.post(@post)
end
......@@ -27,7 +27,7 @@ describe Services::Twitter, :type => :model do
it 'swallows exception raised by twitter always being down' do
skip
expect_any_instance_of(Twitter::Client).to receive(:update).and_raise(StandardError)
expect_any_instance_of(Twitter::REST::Client).to receive(:update).and_raise(StandardError)
@service.post(@post)
end
......@@ -141,7 +141,7 @@ describe Services::Twitter, :type => :model do
it 'returns the original profile photo url' do
user_double = double
expect(user_double).to receive(:profile_image_url_https).with("original").and_return("http://a2.twimg.com/profile_images/uid/avatar.png")
expect_any_instance_of(Twitter::Client).to receive(:user).with("joindiaspora").and_return(user_double)
expect_any_instance_of(Twitter::REST::Client).to receive(:user).with("joindiaspora").and_return(user_double)
@service.nickname = "joindiaspora"
expect(@service.profile_photo_url).to eq("http://a2.twimg.com/profile_images/uid/avatar.png")
......
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