Merge pull request #3946 from MrZYX/feature/1781-include-reshares-in-user-feed
Include reshares in the public user feed, closes #1781
This commit is contained in:
commit
f788f3426a
4 changed files with 9 additions and 1 deletions
|
|
@ -3,6 +3,7 @@
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
* Deleting a post that was shared to Facebook now deletes it from Facebook too [#3980]( https://github.com/diaspora/diaspora/pull/3980)
|
* Deleting a post that was shared to Facebook now deletes it from Facebook too [#3980]( https://github.com/diaspora/diaspora/pull/3980)
|
||||||
|
* Include reshares in a users public atom feed [#1781](https://github.com/diaspora/diaspora/issues/1781)
|
||||||
|
|
||||||
## Bug Fixes
|
## Bug Fixes
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ class UsersController < ApplicationController
|
||||||
if @user = User.find_by_username(params[:username])
|
if @user = User.find_by_username(params[:username])
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.atom do
|
format.atom do
|
||||||
@posts = StatusMessage.where(:author_id => @user.person_id, :public => true).order('created_at DESC').limit(25)
|
@posts = Post.where(:author_id => @user.person_id, :public => true).order('created_at DESC').limit(25)
|
||||||
end
|
end
|
||||||
|
|
||||||
format.any { redirect_to person_path(@user.person) }
|
format.any { redirect_to person_path(@user.person) }
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ atom_feed({'xmlns:thr' => 'http://purl.org/syndication/thread/1.0',
|
||||||
|
|
||||||
|
|
||||||
@posts.each do |post|
|
@posts.each do |post|
|
||||||
|
post = post.absolute_root if post.is_a? Reshare
|
||||||
feed.entry post, :url => "#{@user.url}p/#{post.id}",
|
feed.entry post, :url => "#{@user.url}p/#{post.id}",
|
||||||
:id => "#{@user.url}p/#{post.id}" do |entry|
|
:id => "#{@user.url}p/#{post.id}" do |entry|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,12 @@ describe UsersController do
|
||||||
response.body.should include('a href')
|
response.body.should include('a href')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'includes reshares in the atom feed' do
|
||||||
|
reshare = FactoryGirl.create(:reshare, :author => @user.person)
|
||||||
|
get :public, :username => @user.username, :format => :atom
|
||||||
|
response.body.should include reshare.root.raw_message
|
||||||
|
end
|
||||||
|
|
||||||
it 'redirects to a profile page if html is requested' do
|
it 'redirects to a profile page if html is requested' do
|
||||||
get :public, :username => @user.username
|
get :public, :username => @user.username
|
||||||
response.should be_redirect
|
response.should be_redirect
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue