Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
bridge
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
11
Issues
11
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mastodon
bridge
Commits
6209e5b8
Commit
6209e5b8
authored
Jun 14, 2018
by
Eugen Rochko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compat
parent
a4532e27
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
friends_controller.rb
app/controllers/friends_controller.rb
+6
-4
No files found.
app/controllers/friends_controller.rb
View file @
6209e5b8
...
...
@@ -33,10 +33,12 @@ class FriendsController < ApplicationController
_friends
.
each
do
|
friend
|
next
if
friend
.
relative_account_id
.
blank?
||
friend
.
following
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
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
]
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment