Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Pierre Boudes
mastodon
Commits
af706583
Commit
af706583
authored
7 years ago
by
Eugen Rochko
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix change of status callbacks not setting in_reply_to_account_id and (#3072)
possibly others when expected. Add some tests for it
parent
85c94963
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/models/status.rb
+4
-4
4 additions, 4 deletions
app/models/status.rb
spec/services/process_feed_service_spec.rb
+10
-0
10 additions, 0 deletions
spec/services/process_feed_service_spec.rb
with
14 additions
and
4 deletions
app/models/status.rb
+
4
−
4
View file @
af706583
...
...
@@ -72,7 +72,7 @@ class Status < ApplicationRecord
cache_associated
:account
,
:application
,
:media_attachments
,
:tags
,
:stream_entry
,
mentions: :account
,
reblog:
[
:account
,
:application
,
:stream_entry
,
:tags
,
:media_attachments
,
mentions: :account
],
thread: :account
def
reply?
!
in_reply_to_id
.
nil?
||
super
!
in_reply_to_id
.
nil?
||
attributes
[
'reply'
]
end
def
local?
...
...
@@ -144,9 +144,9 @@ class Status < ApplicationRecord
end
before_validation
:prepare_contents
before_
create
:set_reblog
before_
create
:set_visibility
before_
create
:set_conversation
before_
validation
:set_reblog
before_
validation
:set_visibility
before_
validation
:set_conversation
class
<<
self
def
in_allowed_languages
(
account
)
...
...
This diff is collapsed.
Click to expand it.
spec/services/process_feed_service_spec.rb
+
10
−
0
View file @
af706583
...
...
@@ -31,6 +31,16 @@ RSpec.describe ProcessFeedService do
expect
(
Status
.
find_by
(
uri:
'tag:kickass.zone,2016-10-10:objectId=2:objectType=Status'
)).
to_not
be_nil
end
it
'marks replies as replies'
do
status
=
Status
.
find_by
(
uri:
'tag:kickass.zone,2016-10-10:objectId=2:objectType=Status'
)
expect
(
status
.
reply?
).
to
be
true
end
it
'sets account being replied to when possible'
do
status
=
Status
.
find_by
(
uri:
'tag:kickass.zone,2016-10-10:objectId=2:objectType=Status'
)
expect
(
status
.
in_reply_to_account_id
).
to
eq
status
.
account_id
end
it
'ignores delete statuses unless they existed before'
do
expect
(
Status
.
find_by
(
uri:
'tag:kickass.zone,2016-10-10:objectId=3:objectType=Status'
)).
to
be_nil
expect
(
Status
.
find_by
(
uri:
'tag:kickass.zone,2016-10-10:objectId=12:objectType=Status'
)).
to
be_nil
...
...
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