From 9f11a474d8c13d96f2cafddc686ed334e8758e0c Mon Sep 17 00:00:00 2001 From: Raphael <raphael@joindiaspora.com> Date: Thu, 26 Aug 2010 11:46:04 -0700 Subject: [PATCH] Take out some logging, put in log user on receive --- app/controllers/publics_controller.rb | 1 - app/models/comment.rb | 7 +------ app/models/user.rb | 4 ++-- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index e7b994ff50..011996829b 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 ce119f62c3..1b5be0077d 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 cd071492b3..0e57d0601f 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)) -- GitLab