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
5c99e304
Commit
5c99e304
authored
9 years ago
by
Eugen Rochko
Browse files
Options
Download
Email Patches
Plain Diff
Deleting statuses, deletion propagation
parent
75b3339a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
README.md
+1
-1
README.md
app/helpers/atom_builder_helper.rb
+2
-2
app/helpers/atom_builder_helper.rb
app/models/feed.rb
+1
-1
app/models/feed.rb
app/models/status.rb
+1
-1
app/models/status.rb
app/models/stream_entry.rb
+13
-7
app/models/stream_entry.rb
with
18 additions
and
12 deletions
+18
-12
README.md
+
1
-
1
View file @
5c99e304
...
...
@@ -16,12 +16,12 @@ Mastodon is a federated microblogging engine. An alternative implementation of t
-
REST API, including home and mention timelines
-
OAuth2 provider system for the API
-
Upload header image for profile page
-
Deleting statuses, deletion propagation
Missing:
-
Media attachments (photos, videos)
-
UI to post, reblog, favourite, follow and unfollow
-
Deleting statuses, deletion propagation
-
Streaming API
## Configuration
...
...
This diff is collapsed.
Click to expand it.
app/helpers/atom_builder_helper.rb
+
2
-
2
View file @
5c99e304
...
...
@@ -147,8 +147,8 @@ module AtomBuilderHelper
def
include_entry
(
xml
,
stream_entry
)
unique_id
xml
,
stream_entry
.
created_at
,
stream_entry
.
activity_id
,
stream_entry
.
activity_type
published_at
xml
,
stream_entry
.
activity
.
created_at
updated_at
xml
,
stream_entry
.
activity
.
updated_at
published_at
xml
,
stream_entry
.
created_at
updated_at
xml
,
stream_entry
.
updated_at
title
xml
,
stream_entry
.
title
content
xml
,
stream_entry
.
content
verb
xml
,
stream_entry
.
verb
...
...
This diff is collapsed.
Click to expand it.
app/models/feed.rb
+
1
-
1
View file @
5c99e304
...
...
@@ -12,7 +12,7 @@ class Feed
return
PrecomputeFeedService
.
new
.
(
@type
,
@account
).
take
(
limit
)
if
unhydrated
.
empty?
&&
offset
==
0
Status
.
where
(
id:
unhydrated
).
with_includes
.
with_counters
.
each
{
|
status
|
status_map
[
status
.
id
.
to_s
]
=
status
}
return
unhydrated
.
map
{
|
id
|
status_map
[
id
]
}
return
unhydrated
.
map
{
|
id
|
status_map
[
id
]
}
.
compact
end
private
...
...
This diff is collapsed.
Click to expand it.
app/models/status.rb
+
1
-
1
View file @
5c99e304
...
...
@@ -4,7 +4,7 @@ class Status < ActiveRecord::Base
belongs_to
:thread
,
foreign_key:
'in_reply_to_id'
,
class_name:
'Status'
,
inverse_of: :replies
belongs_to
:reblog
,
foreign_key:
'reblog_of_id'
,
class_name:
'Status'
,
inverse_of: :reblogs
has_one
:stream_entry
,
as: :activity
,
dependent: :destroy
has_one
:stream_entry
,
as: :activity
has_many
:favourites
,
inverse_of: :status
,
dependent: :destroy
has_many
:reblogs
,
foreign_key:
'reblog_of_id'
,
class_name:
'Status'
,
inverse_of: :reblog
,
dependent: :destroy
...
...
This diff is collapsed.
Click to expand it.
app/models/stream_entry.rb
+
13
-
7
View file @
5c99e304
...
...
@@ -5,11 +5,11 @@ class StreamEntry < ActiveRecord::Base
validates
:account
,
:activity
,
presence:
true
def
object_type
targeted?
?
:activity
:
self
.
activity
.
object_type
orphaned?
?
:activity
:
(
targeted?
?
:activity
:
self
.
activity
.
object_type
)
end
def
verb
self
.
activity
.
verb
orphaned?
?
:delete
:
self
.
activity
.
verb
end
def
targeted?
...
...
@@ -17,15 +17,15 @@ class StreamEntry < ActiveRecord::Base
end
def
target
self
.
activity
.
target
orphaned?
?
nil
:
self
.
activity
.
target
end
def
title
self
.
activity
.
title
orphaned?
?
nil
:
self
.
activity
.
title
end
def
content
self
.
activity
.
content
orphaned?
?
nil
:
self
.
activity
.
content
end
def
threaded?
...
...
@@ -33,10 +33,16 @@ class StreamEntry < ActiveRecord::Base
end
def
thread
self
.
activity
.
thread
orphaned?
?
nil
:
self
.
activity
.
thread
end
def
mentions
self
.
activity
.
mentions
orphaned?
?
[]
:
self
.
activity
.
mentions
end
private
def
orphaned?
self
.
activity
.
nil?
end
end
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