fixed issue with diaspora handles not displaying in streams
This commit is contained in:
parent
28a22d9fc3
commit
2758ea1625
3 changed files with 3 additions and 13 deletions
|
|
@ -170,7 +170,7 @@ class AspectsController < ApplicationController
|
|||
|
||||
private
|
||||
def hashes_for_contacts contacts
|
||||
people = Person.all(:id.in => contacts.map{|c| c.person_id}, :fields => [:profile])
|
||||
people = Person.all(:id.in => contacts.map{|c| c.person_id}, :fields => [:profile, :diaspora_handle])
|
||||
people_hash = {}
|
||||
people.each{|p| people_hash[p.id] = p}
|
||||
contacts.map{|c| {:contact => c, :person => people_hash[c.person_id.to_id]}}
|
||||
|
|
@ -201,7 +201,7 @@ class AspectsController < ApplicationController
|
|||
photo_hash = Photo.hash_from_post_ids post_ids
|
||||
|
||||
post_person_ids.uniq!
|
||||
posters = Person.all(:id.in => post_person_ids, :fields => [:profile, :owner_id])
|
||||
posters = Person.all(:id.in => post_person_ids, :fields => [:profile, :owner_id, :diaspora_handle])
|
||||
posters_hash = {}
|
||||
posters.each{|poster| posters_hash[poster.id] = poster}
|
||||
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ class Person
|
|||
|
||||
def self.from_post_comment_hash(hash)
|
||||
person_ids = hash.values.flatten.map!{|c| c.person_id}.uniq
|
||||
people = where(:id.in => person_ids).fields(:profile)
|
||||
people = where(:id.in => person_ids).fields(:profile, :diaspora_handle)
|
||||
people_hash = {}
|
||||
people.each{|p| people_hash[p.id] = p}
|
||||
people_hash
|
||||
|
|
|
|||
|
|
@ -119,16 +119,6 @@ class Photo < Post
|
|||
where(:status_message_id.in => post_ids)
|
||||
}
|
||||
|
||||
=begin
|
||||
private
|
||||
def delete_parent_if_no_photos_or_message
|
||||
parent = self.status_message
|
||||
photos = parent.photos || []
|
||||
if parent.message.blank? && photos.count <= 1
|
||||
parent.delete
|
||||
end
|
||||
end
|
||||
=end
|
||||
end
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue