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
42633406
Commit
42633406
authored
Jun 20, 2017
by
lain
Browse files
Merge branch 'develop' of ssh.gitgud.io:lambadalambda/pleroma into develop
parents
14d9de39
b76001de
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/router.ex
View file @
42633406
...
...
@@ -26,8 +26,8 @@ def user_fetcher(username) do
scope
"/api"
,
Pleroma
.
Web
do
pipe_through
:api
get
"/help/test"
,
TwitterAPI
.
Controller
,
:help_test
get
"/statusnet/config"
,
TwitterAPI
.
Controller
,
:config
get
"/help/test"
,
TwitterAPI
.
Util
Controller
,
:help_test
get
"/statusnet/config"
,
TwitterAPI
.
Util
Controller
,
:config
get
"/statuses/public_timeline"
,
TwitterAPI
.
Controller
,
:public_timeline
get
"/statuses/public_and_external_timeline"
,
TwitterAPI
.
Controller
,
:public_and_external_timeline
...
...
lib/pleroma/web/twitter_api/controllers/util_controller.ex
0 → 100644
View file @
42633406
defmodule
Pleroma
.
Web
.
TwitterAPI
.
UtilController
do
use
Pleroma
.
Web
,
:controller
alias
Pleroma
.
Web
def
help_test
(
conn
,
_params
)
do
json
(
conn
,
"ok"
)
end
def
config
(
conn
,
_params
)
do
json
(
conn
,
%{
site:
%{
name:
Web
.
base_url
,
server:
Web
.
base_url
,
textlimit:
-
1
}
})
end
end
lib/pleroma/web/twitter_api/twitter_api_controller.ex
View file @
42633406
...
...
@@ -2,7 +2,7 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
use
Pleroma
.
Web
,
:controller
alias
Pleroma
.
Web
.
TwitterAPI
.
{
TwitterAPI
,
UserView
}
alias
Pleroma
.
Web
.
TwitterAPI
.
Representers
.
ActivityRepresenter
alias
Pleroma
.
{
Web
,
Repo
,
Activity
}
alias
Pleroma
.
{
Repo
,
Activity
}
alias
Pleroma
.
Web
.
ActivityPub
.
ActivityPub
alias
Ecto
.
Changeset
...
...
@@ -122,30 +122,12 @@ def upload(conn, %{"media" => media}) do
|>
send_resp
(
200
,
response
)
end
def
help_test
(
conn
,
_params
)
do
conn
|>
json_reply
(
200
,
Poison
.
encode!
(
"ok"
))
end
def
upload_json
(
conn
,
%{
"media"
=>
media
})
do
response
=
TwitterAPI
.
upload
(
media
,
"json"
)
conn
|>
json_reply
(
200
,
response
)
end
def
config
(
conn
,
_params
)
do
response
=
%{
site:
%{
name:
Web
.
base_url
,
server:
Web
.
base_url
,
textlimit:
-
1
}
}
|>
Poison
.
encode!
conn
|>
json_reply
(
200
,
response
)
end
def
favorite
(%{
assigns:
%{
user:
user
}}
=
conn
,
%{
"id"
=>
id
})
do
activity
=
Repo
.
get
(
Activity
,
id
)
{
:ok
,
status
}
=
TwitterAPI
.
favorite
(
user
,
activity
)
...
...
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