Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
ccd6b195
Verified
Commit
ccd6b195
authored
Nov 10, 2018
by
Haelwenn
Browse files
lib/pleroma/web/admin_api/admin_api_controller.ex: Support status reply of Relay.{un,}follow
parent
7fbfd2db
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/admin_api/admin_api_controller.ex
View file @
ccd6b195
...
...
@@ -78,7 +78,7 @@ def right_delete(
when
right
in
[
"moderator"
,
"admin"
]
do
if
admin_nickname
==
nickname
do
conn
|>
p
os
t_status
(
403
)
|>
p
u
t_status
(
403
)
|>
json
(%{
error:
"You can't revoke your own admin status."
})
else
user
=
User
.
get_by_nickname
(
nickname
)
...
...
@@ -102,17 +102,29 @@ def right_delete(conn, _) do
end
def
relay_follow
(
conn
,
%{
"relay_url"
=>
target
})
do
:ok
=
Relay
.
follow
(
target
)
status
=
Relay
.
follow
(
target
)
conn
|>
json
(
target
)
if
status
==
:ok
do
conn
|>
json
(
target
)
else
conn
|>
put_status
(
500
)
|>
json
(
target
)
end
end
def
relay_unfollow
(
conn
,
%{
"relay_url"
=>
target
})
do
:ok
=
Relay
.
unfollow
(
target
)
status
=
Relay
.
unfollow
(
target
)
conn
|>
json
(
target
)
if
status
==
:ok
do
conn
|>
json
(
target
)
else
conn
|>
put_status
(
500
)
|>
json
(
target
)
end
end
@shortdoc
"Get a account registeration invite token (base64 string)"
...
...
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