Don't get posts for a hovercard request
This commit is contained in:
parent
4c380b4edf
commit
9765bdc391
1 changed files with 24 additions and 23 deletions
|
|
@ -75,33 +75,35 @@ class PeopleController < ApplicationController
|
||||||
if @person
|
if @person
|
||||||
@profile = @person.profile
|
@profile = @person.profile
|
||||||
|
|
||||||
if current_user
|
unless params[:format] == "json" # hovercard
|
||||||
@contact = current_user.contact_for(@person)
|
if current_user
|
||||||
@aspects_with_person = []
|
@contact = current_user.contact_for(@person)
|
||||||
if @contact && !params[:only_posts]
|
@aspects_with_person = []
|
||||||
@aspects_with_person = @contact.aspects
|
if @contact && !params[:only_posts]
|
||||||
@aspect_ids = @aspects_with_person.map(&:id)
|
@aspects_with_person = @contact.aspects
|
||||||
@contacts_of_contact_count = @contact.contacts.count
|
@aspect_ids = @aspects_with_person.map(&:id)
|
||||||
@contacts_of_contact = @contact.contacts.limit(8)
|
@contacts_of_contact_count = @contact.contacts.count
|
||||||
|
@contacts_of_contact = @contact.contacts.limit(8)
|
||||||
|
|
||||||
|
else
|
||||||
|
@contact ||= Contact.new
|
||||||
|
@contacts_of_contact_count = 0
|
||||||
|
@contacts_of_contact = []
|
||||||
|
end
|
||||||
|
|
||||||
|
if (@person != current_user.person) && !@contact.persisted?
|
||||||
|
@commenting_disabled = true
|
||||||
|
else
|
||||||
|
@commenting_disabled = false
|
||||||
|
end
|
||||||
|
@posts = current_user.posts_from(@person).where(:type => ["StatusMessage", "ActivityStreams::Photo"]).includes(:comments).limit(15).where(StatusMessage.arel_table[:created_at].lt(max_time))
|
||||||
else
|
else
|
||||||
@contact ||= Contact.new
|
|
||||||
@contacts_of_contact_count = 0
|
|
||||||
@contacts_of_contact = []
|
|
||||||
end
|
|
||||||
|
|
||||||
if (@person != current_user.person) && !@contact.persisted?
|
|
||||||
@commenting_disabled = true
|
@commenting_disabled = true
|
||||||
else
|
@posts = @person.posts.where(:type => ["StatusMessage", "ActivityStreams::Photo"], :public => true).includes(:comments).limit(15).where(StatusMessage.arel_table[:created_at].lt(max_time)).order('posts.created_at DESC')
|
||||||
@commenting_disabled = false
|
|
||||||
end
|
end
|
||||||
@posts = current_user.posts_from(@person).where(:type => ["StatusMessage", "ActivityStreams::Photo"]).includes(:comments).limit(15).where(StatusMessage.arel_table[:created_at].lt(max_time))
|
|
||||||
else
|
|
||||||
@commenting_disabled = true
|
|
||||||
@posts = @person.posts.where(:type => ["StatusMessage", "ActivityStreams::Photo"], :public => true).includes(:comments).limit(15).where(StatusMessage.arel_table[:created_at].lt(max_time)).order('posts.created_at DESC')
|
|
||||||
end
|
|
||||||
|
|
||||||
@posts = PostsFake.new(@posts)
|
@posts = PostsFake.new(@posts)
|
||||||
|
end
|
||||||
|
|
||||||
if params[:only_posts]
|
if params[:only_posts]
|
||||||
render :partial => 'shared/stream', :locals => {:posts => @posts}
|
render :partial => 'shared/stream', :locals => {:posts => @posts}
|
||||||
|
|
@ -120,7 +122,6 @@ class PeopleController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def retrieve_remote
|
def retrieve_remote
|
||||||
if params[:diaspora_handle]
|
if params[:diaspora_handle]
|
||||||
webfinger(params[:diaspora_handle], :single_aspect_form => true)
|
webfinger(params[:diaspora_handle], :single_aspect_form => true)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue