Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pleroma
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
kaniini
pleroma
Commits
45a935f0
Commit
45a935f0
authored
6 years ago
by
lain
Browse files
Options
Downloads
Plain Diff
Merge branch 'users' into 'develop'
Fix users lookup/return type See merge request
pleroma/pleroma!201
parents
bb639a36
fa0c2727
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/pleroma/web/activity_pub/activity_pub_controller.ex
+2
-0
2 additions, 0 deletions
lib/pleroma/web/activity_pub/activity_pub_controller.ex
lib/pleroma/web/ostatus/ostatus_controller.ex
+15
-10
15 additions, 10 deletions
lib/pleroma/web/ostatus/ostatus_controller.ex
with
17 additions
and
10 deletions
lib/pleroma/web/activity_pub/activity_pub_controller.ex
+
2
−
0
View file @
45a935f0
...
...
@@ -15,6 +15,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do
conn
|>
put_resp_header
(
"content-type"
,
"application/activity+json"
)
|>
json
(
UserView
.
render
(
"user.json"
,
%{
user:
user
}))
else
nil
->
{
:error
,
:not_found
}
end
end
...
...
This diff is collapsed.
Click to expand it.
lib/pleroma/web/ostatus/ostatus_controller.ex
+
15
−
10
View file @
45a935f0
...
...
@@ -12,19 +12,24 @@ defmodule Pleroma.Web.OStatus.OStatusController do
action_fallback
(
:errors
)
def
feed_redirect
(
conn
,
%{
"nickname"
=>
nickname
})
do
with
{
_
,
%
User
{}
=
user
}
<-
{
:user
,
User
.
get_cached_by_nickname
(
nickname
)}
do
case
get_format
(
conn
)
do
"html"
->
Fallback
.
RedirectController
.
redirector
(
conn
,
nil
)
"activity+json"
->
ActivityPubController
.
call
(
conn
,
:user
)
_
->
redirect
(
conn
,
external:
OStatus
.
feed_path
(
user
))
end
else
{
:user
,
nil
}
->
{
:error
,
:not_found
}
case
get_format
(
conn
)
do
"html"
->
Fallback
.
RedirectController
.
redirector
(
conn
,
nil
)
"activity+json"
->
ActivityPubController
.
call
(
conn
,
:user
)
_
->
with
%
User
{}
=
user
<-
User
.
get_cached_by_nickname
(
nickname
)
do
redirect
(
conn
,
external:
OStatus
.
feed_path
(
user
))
else
nil
->
{
:error
,
:not_found
}
end
end
end
def
feed
(
conn
,
%{
"nickname"
=>
nickname
}
=
params
)
do
with
{
_
,
%
User
{}
=
user
}
<-
{
:user
,
User
.
get_cached_by_nickname
(
nickname
)
}
do
with
%
User
{}
=
user
<-
User
.
get_cached_by_nickname
(
nickname
)
do
query_params
=
Map
.
take
(
params
,
[
"max_id"
])
|>
Map
.
merge
(%{
"whole_db"
=>
true
,
"actor_id"
=>
user
.
ap_id
})
...
...
@@ -43,7 +48,7 @@ defmodule Pleroma.Web.OStatus.OStatusController do
|>
put_resp_content_type
(
"application/atom+xml"
)
|>
send_resp
(
200
,
response
)
else
{
:user
,
nil
}
->
{
:error
,
:not_found
}
nil
->
{
:error
,
:not_found
}
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment