Take out some logging, put in log user on receive

This commit is contained in:
Raphael 2010-08-26 11:46:04 -07:00
parent 7feb30e3e1
commit 9f11a474d8
3 changed files with 3 additions and 9 deletions

View file

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

View file

@ -58,12 +58,7 @@ class Comment
end end
def signature_valid? def signature_valid?
if person Rails.logger.warn "Received comment has no person" unless 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
verify_signature(creator_signature, person) verify_signature(creator_signature, person)
end end

View file

@ -166,7 +166,7 @@ class User
def receive xml def receive xml
object = Diaspora::Parser.from_xml(xml) object = Diaspora::Parser.from_xml(xml)
Rails.logger.debug("Receiving object:\n#{object.inspect}") 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.is_a? Retraction
if object.type == 'Person' && object.signature_valid? if object.type == 'Person' && object.signature_valid?
@ -195,7 +195,7 @@ class User
person.save person.save
elsif object.is_a?(Comment) 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 object.save
dispatch_comment object unless owns?(object) dispatch_comment object unless owns?(object)
object.socket_to_uid(id) if (object.respond_to?(:socket_to_uid) && !self.owns?(object)) object.socket_to_uid(id) if (object.respond_to?(:socket_to_uid) && !self.owns?(object))