diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index e7b994ff506413463524c9babd0be7ef9ed61191..011996829b8ece7050ea68b1684876acf17e7842 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -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 diff --git a/app/models/comment.rb b/app/models/comment.rb index ce119f62c39c4c2cb899fc7e79c564e65b9907fc..1b5be0077dc464fdfe58fc1e67cd97d9e6e65a59 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -58,12 +58,7 @@ class Comment end def signature_valid? - if person - Rails.logger.warn "Received comment has person #{person.inspect}" if person - Rails.logger.warn "Received comment has person key #{person.serialized_key}" if person - else - Rails.logger.warn "Received comment has no person" - end + Rails.logger.warn "Received comment has no person" unless person verify_signature(creator_signature, person) end diff --git a/app/models/user.rb b/app/models/user.rb index cd071492b371a260897c8b7ca86baf8710299f3b..0e57d0601fda718b62923605fa72d29cf92626d4 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -166,7 +166,7 @@ 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? + 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,7 +195,7 @@ class User person.save elsif object.is_a?(Comment) - raise "Signature was not valid on: #{object.inspect}" unless object.post.person == self || object.verify_post_creator_signature + raise "In receive for #{self.real_name}, signature was not valid on: #{object.inspect}" unless object.post.person == self || 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))