log the 'received comment but no corresponding post' case

This commit is contained in:
MrZYX 2011-02-26 16:41:49 +01:00
parent 1adcc4cc99
commit 0fc5f1c043

View file

@ -70,6 +70,11 @@ module Postzord
@object.sender_handle = @sender.diaspora_handle
end
# abort if we haven't received the post to a comment
if @object.is_a?(Comment) && @object.post.nil?
Rails.logger.info("event=receive status=abort reason='received a comment but no corresponding post' recipient=#{@user_person.diaspora_handle} sender=#{@sender.diaspora_handle} payload_type=#{@object.class})")
return false
end
if (@author.diaspora_handle != xml_author)
Rails.logger.info("event=receive status=abort reason='author in xml does not match retrieved person' payload_type=#{@object.class} recipient=#{@user_person.diaspora_handle} sender=#{@sender.diaspora_handle}")