Save the person on receiving a comment

This commit is contained in:
Raphael 2010-08-26 14:38:06 -07:00
parent 6a48c07c90
commit 31f79be068
2 changed files with 2 additions and 1 deletions

View file

@ -58,7 +58,6 @@ class Comment
end
def signature_valid?
return true if person.nil?
verify_signature(creator_signature, person)
end

View file

@ -166,6 +166,8 @@ class User
def receive xml
object = Diaspora::Parser.from_xml(xml)
Rails.logger.debug("Receiving object:\n#{object.inspect}")
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?