Merge branch 'master' of github.com:diaspora/diaspora

This commit is contained in:
danielvincent 2010-08-26 15:02:29 -07:00
commit 1d515e7b7e
5 changed files with 9 additions and 7 deletions

View file

@ -29,7 +29,6 @@ class PublicsController < ApplicationController
Rails.logger.error("Received post #{params[:xml]} for nonexistent person #{params[:id]}")
return
end
Rails.logger.debug "PublicsController has received: #{params[:xml]}"
@user.receive params[:xml] if params[:xml]
end

View file

@ -58,9 +58,7 @@ class Comment
end
def signature_valid?
Rails.logger.warn "Received comment has person #{person.inspect}"
Rails.logger.warn "Received comment has person key #{person.serialized_key}" if person
verify_signature(creator_signature, person) && verify_signature(post_creator_signator, post.person)
verify_signature(creator_signature, person)
end
protected

View file

@ -21,7 +21,7 @@ class Group
end
def posts_by_person_id( id )
id = ensure_bson id
id = id.to_id
posts.detect{|x| x.person.id == id }
end
end

View file

@ -51,7 +51,7 @@ class User
puts posts_to_move.inspect
to_group.people << friend
to_group.posts << posts_to_move
from_group.person_ids.delete(ensure_bson(friend.id))
from_group.person_ids.delete(friend.id.to_id)
posts_to_move.each{ |x| from_group.post_ids.delete(x.id)}
from_group.save
to_group.save
@ -166,7 +166,9 @@ class User
def receive xml
object = Diaspora::Parser.from_xml(xml)
Rails.logger.debug("Receiving object:\n#{object.inspect}")
raise "Signature was not valid on: #{object.inspect}" unless object.signature_valid?
Rails.logger.debug("From: #{object.person.inspect}") if object.person
object.person.save if object.is_a?(Comment) && Person.find_by_id(object.person_id).nil?
raise "In receive for #{self.real_name}, signature was not valid on: #{object.inspect}" unless object.signature_valid?
if object.is_a? Retraction
if object.type == 'Person' && object.signature_valid?
@ -195,6 +197,8 @@ class User
person.save
elsif object.is_a?(Comment)
raise "In receive for #{self.real_name}, signature was not valid on: #{object.inspect}" unless object.post.person == self.person || object.verify_post_creator_signature
object.save
dispatch_comment object unless owns?(object)
object.socket_to_uid(id) if (object.respond_to?(:socket_to_uid) && !self.owns?(object))
else

View file

@ -16,6 +16,7 @@
stuff
-for person in group.people
%li.person
= image_tag (person.profile.image_url(:thumb_small),:size => "30x30") unless person.profile.image_url.nil?
= person.real_name