From 9b249281a1c2abf49559c5b043b465e2cdcca3d2 Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 12 Oct 2010 16:01:36 -0700 Subject: [PATCH] moved verify comment sig before any saving goes on --- lib/diaspora/user/receiving.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/diaspora/user/receiving.rb b/lib/diaspora/user/receiving.rb index b23cbcf52..3a8fc5fa6 100644 --- a/lib/diaspora/user/receiving.rb +++ b/lib/diaspora/user/receiving.rb @@ -79,12 +79,12 @@ module Diaspora def receive_comment comment, xml comment.person = Diaspora::Parser.parse_or_find_person_from_xml( xml ).save if comment.person.nil? + raise "In receive for #{self.real_name}, signature was not valid on: #{comment.inspect}" unless comment.post.person == self.person || comment.verify_post_creator_signature self.visible_people = self.visible_people | [comment.person] self.save Rails.logger.debug("The person parsed from comment xml is #{comment.person.inspect}") unless comment.person.nil? comment.person.save Rails.logger.debug("From: #{comment.person.inspect}") if comment.person - raise "In receive for #{self.real_name}, signature was not valid on: #{comment.inspect}" unless comment.post.person == self.person || comment.verify_post_creator_signature comment.save unless owns?(comment) dispatch_comment comment