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
2b628f23
Commit
2b628f23
authored
Aug 06, 2018
by
kaniini
Browse files
relay: only relay create activities
parent
ae3cb652
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/activity_pub/relay.ex
View file @
2b628f23
defmodule
Pleroma
.
Web
.
ActivityPub
.
Relay
do
alias
Pleroma
.
{
User
,
Object
}
alias
Pleroma
.
{
User
,
Object
,
Activity
}
alias
Pleroma
.
Web
.
ActivityPub
.
ActivityPub
require
Logger
...
...
@@ -31,7 +31,7 @@ def unfollow(target_instance) do
:ok
end
def
publish
(
activity
)
do
def
publish
(
%
Activity
{
data:
%{
"type"
=>
"Create"
}}
=
activity
)
do
with
%
User
{}
=
user
<-
get_actor
(),
%
Object
{}
=
object
<-
Object
.
normalize
(
activity
.
data
[
"object"
][
"id"
])
do
ActivityPub
.
announce
(
user
,
object
)
...
...
@@ -39,4 +39,6 @@ def publish(activity) do
e
->
Logger
.
error
(
"error:
#{
inspect
(
e
)
}
"
)
end
end
def
publish
(
_
),
do
:
nil
end
Write
Preview
Supports
Markdown
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