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
normandy
pleroma
Commits
009fcd2a
Commit
009fcd2a
authored
7 years ago
by
lain
Browse files
Options
Downloads
Patches
Plain Diff
Stop adding statusnetConversationIds.
parent
379caca0
No related branches found
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.ex
+0
-20
0 additions, 20 deletions
lib/pleroma/web/activity_pub/activity_pub.ex
test/web/twitter_api/twitter_api_test.exs
+1
-3
1 addition, 3 deletions
test/web/twitter_api/twitter_api_test.exs
with
1 addition
and
23 deletions
lib/pleroma/web/activity_pub/activity_pub.ex
+
0
−
20
View file @
009fcd2a
...
...
@@ -33,8 +33,6 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|>
Map
.
merge
(
additional
)
with
{
:ok
,
activity
}
<-
insert
(
activity
)
do
{
:ok
,
activity
}
=
add_conversation_id
(
activity
)
if
actor
.
local
do
Pleroma
.
Web
.
Federator
.
enqueue
(
:publish
,
activity
)
end
...
...
@@ -43,24 +41,6 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
end
end
defp
add_conversation_id
(
activity
)
do
if
is_integer
(
activity
.
data
[
"statusnetConversationId"
])
do
{
:ok
,
activity
}
else
data
=
activity
.
data
|>
put_in
([
"object"
,
"statusnetConversationId"
],
activity
.
id
)
|>
put_in
([
"statusnetConversationId"
],
activity
.
id
)
object
=
Object
.
get_by_ap_id
(
activity
.
data
[
"object"
][
"id"
])
changeset
=
Ecto
.
Changeset
.
change
(
object
,
data:
data
[
"object"
])
Repo
.
update
(
changeset
)
changeset
=
Ecto
.
Changeset
.
change
(
activity
,
data:
data
)
Repo
.
update
(
changeset
)
end
end
def
like
(%
User
{
ap_id:
ap_id
}
=
user
,
%
Object
{
data:
%{
"id"
=>
id
}}
=
object
)
do
cond
do
# There's already a like here, so return the original activity.
...
...
This diff is collapsed.
Click to expand it.
test/web/twitter_api/twitter_api_test.exs
+
1
−
3
View file @
009fcd2a
...
...
@@ -41,11 +41,9 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
assert
Enum
.
member?
(
get_in
(
activity
.
data
,
[
"to"
]),
"https://www.w3.org/ns/activitystreams#Public"
)
assert
Enum
.
member?
(
get_in
(
activity
.
data
,
[
"to"
]),
"shp"
)
# Add a context
+ 'statusnet_conversation_id'
# Add a context
assert
is_binary
(
get_in
(
activity
.
data
,
[
"context"
]))
assert
is_binary
(
get_in
(
activity
.
data
,
[
"object"
,
"context"
]))
assert
get_in
(
activity
.
data
,
[
"object"
,
"statusnetConversationId"
])
==
activity
.
id
assert
get_in
(
activity
.
data
,
[
"statusnetConversationId"
])
==
activity
.
id
assert
is_list
(
activity
.
data
[
"object"
][
"attachment"
])
...
...
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