Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Open sidebar
Tiger Ton
mastodon
Commits
c2f31d90
Commit
c2f31d90
authored
6 years ago
by
ThibG
Committed by
Eugen Rochko
6 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Fix handling of ActivityPub activities lacking some attributes (#8864)
parent
38a48a62
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
app/lib/activitypub/activity/accept.rb
+1
-1
app/lib/activitypub/activity/accept.rb
app/lib/activitypub/activity/delete.rb
+2
-0
app/lib/activitypub/activity/delete.rb
app/lib/activitypub/activity/reject.rb
+1
-1
app/lib/activitypub/activity/reject.rb
app/lib/activitypub/activity/undo.rb
+2
-0
app/lib/activitypub/activity/undo.rb
with
6 additions
and
2 deletions
+6
-2
app/lib/activitypub/activity/accept.rb
+
1
-
1
View file @
c2f31d90
...
...
@@ -26,7 +26,7 @@ class ActivityPub::Activity::Accept < ActivityPub::Activity
end
def
relay
@relay
||=
Relay
.
find_by
(
follow_activity_id:
object_uri
)
@relay
||=
Relay
.
find_by
(
follow_activity_id:
object_uri
)
unless
object_uri
.
nil?
end
def
relay_follow?
...
...
This diff is collapsed.
Click to expand it.
app/lib/activitypub/activity/delete.rb
+
2
-
0
View file @
c2f31d90
...
...
@@ -17,6 +17,8 @@ class ActivityPub::Activity::Delete < ActivityPub::Activity
end
def
delete_note
return
if
object_uri
.
nil?
@status
=
Status
.
find_by
(
uri:
object_uri
,
account:
@account
)
@status
||=
Status
.
find_by
(
uri:
@object
[
'atomUri'
],
account:
@account
)
if
@object
.
is_a?
(
Hash
)
&&
@object
[
'atomUri'
].
present?
...
...
This diff is collapsed.
Click to expand it.
app/lib/activitypub/activity/reject.rb
+
1
-
1
View file @
c2f31d90
...
...
@@ -28,7 +28,7 @@ class ActivityPub::Activity::Reject < ActivityPub::Activity
end
def
relay
@relay
||=
Relay
.
find_by
(
follow_activity_id:
object_uri
)
@relay
||=
Relay
.
find_by
(
follow_activity_id:
object_uri
)
unless
object_uri
.
nil?
end
def
relay_follow?
...
...
This diff is collapsed.
Click to expand it.
app/lib/activitypub/activity/undo.rb
+
2
-
0
View file @
c2f31d90
...
...
@@ -19,6 +19,8 @@ class ActivityPub::Activity::Undo < ActivityPub::Activity
private
def
undo_announce
return
if
object_uri
.
nil?
status
=
Status
.
find_by
(
uri:
object_uri
,
account:
@account
)
status
||=
Status
.
find_by
(
uri:
@object
[
'atomUri'
],
account:
@account
)
if
@object
.
is_a?
(
Hash
)
&&
@object
[
'atomUri'
].
present?
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets