Inspect the friend before calling unfriended by

This commit is contained in:
Raphael 2010-08-16 10:38:36 -07:00
parent ad2d8f8b46
commit 0e67ef8d7e

View file

@ -139,14 +139,13 @@ class User
###### Receiving #######
def receive xml
Rails.logger.info("Received xml is #{xml}")
object = Diaspora::Parser.from_xml(xml)
Rails.logger.debug("Receiving object:\n#{object.inspect}")
if object.is_a? Retraction
if object.type == 'Person' && object.signature_valid?
Rails.logger.info( "the person id is #{object.post_id} the friend found is #{friends.first(object.post_id)}")
Rails.logger.info( "the person id is #{object.post_id} the friend found is #{friends.first(:id => object.post_id).inspect}")
unfriended_by friends.first(:id => object.post_id)
else