Commit 6209e5b8 authored by Eugen Rochko's avatar Eugen Rochko

Fix compat

parent a4532e27
......@@ -33,11 +33,13 @@ class FriendsController < ApplicationController
_friends.each do |friend|
next if friend.relative_account_id.blank? || friend.following
begin
relationship = current_user.mastodon_client.perform_request(:post, "/api/v1/accounts/#{friend.relative_account_id}/follow")
friend.following = relationship['following'] || relationship['requested']
rescue HTTP::Error, OpenSSL::SSL::SSLError, Oj::ParseError
next
end
end
Rails.cache.write("#{current_user.id}/friends", _friends.map { |f| [f.id, f.relative_account_id, f.following] })
end
......
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