diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index 72d32baf0e7f1dd5a21ee5dc42f5e986aee832ae..cfccd0f1972dfcff922153f61306788dcf48d710 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -7,7 +7,7 @@ class AccountsController < ApplicationController def show respond_to do |format| format.html { @statuses = @account.statuses.order('id desc').with_includes.with_counters.paginate(page: params[:page], per_page: 10)} - format.atom + format.atom { @entries = @account.stream_entries.order('id desc').with_includes } end end diff --git a/app/helpers/atom_builder_helper.rb b/app/helpers/atom_builder_helper.rb index da3a1a9b807e7fa8eee8cd8f82ac37c6106aa5f0..b9eb79fbd938dbdd17246d25e3e1fb1c843b42c9 100644 --- a/app/helpers/atom_builder_helper.rb +++ b/app/helpers/atom_builder_helper.rb @@ -40,7 +40,7 @@ module AtomBuilderHelper end def title(xml, title) - xml.title title + xml.title strip_tags(title || '').truncate(80) end def author(xml, &block) diff --git a/app/models/status.rb b/app/models/status.rb index 7c5cd2f8aea3f78f7041a7eb90d16eda303674d1..08b5ee75e2cd16901970e8929f033d562a6f7d5c 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -46,7 +46,7 @@ class Status < ActiveRecord::Base end def title - content.truncate(80, omission: "...") + content end def reblogs_count diff --git a/app/models/stream_entry.rb b/app/models/stream_entry.rb index 0cc959a1c5d795f3d3357b8f8897485c7a637ffb..68a33ccf70870d214bc8ad2f4ca6f9e57ca50589 100644 --- a/app/models/stream_entry.rb +++ b/app/models/stream_entry.rb @@ -4,6 +4,8 @@ class StreamEntry < ActiveRecord::Base validates :account, :activity, presence: true + scope :with_includes, -> { includes(:activity) } + def object_type orphaned? ? :activity : (targeted? ? :activity : self.activity.object_type) end diff --git a/app/views/accounts/show.atom.ruby b/app/views/accounts/show.atom.ruby index eaa4c63b135e2dd48749bd1fe4f9d916f7f2ee9a..e2ae57cc454492554773d4fa18c24a2552ff4286 100644 --- a/app/views/accounts/show.atom.ruby +++ b/app/views/accounts/show.atom.ruby @@ -15,7 +15,7 @@ Nokogiri::XML::Builder.new do |xml| link_hub xml, Rails.configuration.x.hub_url link_salmon xml, api_salmon_url(@account.id) - @account.stream_entries.order('id desc').each do |stream_entry| + @entries.order('id desc').each do |stream_entry| entry(xml, false) do include_entry xml, stream_entry end