diff --git a/app/models/photo.rb b/app/models/photo.rb index 5a5dd1c90..8521c5597 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -3,7 +3,7 @@ class Photo < Post include MongoMapper::Document mount_uploader :image, ImageUploader - xml_reader :remote_photo + xml_accessor :remote_photo xml_reader :album_id key :album_id, ObjectId @@ -23,10 +23,11 @@ class Photo < Post end def remote_photo - User.owner.url.chop + image.url + @remote_photo ||= User.owner.url.chop + image.url end def remote_photo= remote_path + @remote_photo = remote_path image.download! remote_path image.store! end diff --git a/lib/common.rb b/lib/common.rb index c457258e4..461f050f7 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -51,7 +51,7 @@ module Diaspora User.owner.receive_friend_request(p) #This line checks if the sender was in the database, among other things? elsif p.respond_to?(:person) && !(p.person.nil?) && !(p.person.is_a? User) #WTF - p.save + Rails.logger.info("Saving object with success: #{p.save}") end #p.save if p.respond_to?(:person) && !(p.person == nil) #WTF end diff --git a/lib/encryptable.rb b/lib/encryptable.rb index cc5682f95..7cbbfe764 100644 --- a/lib/encryptable.rb +++ b/lib/encryptable.rb @@ -10,6 +10,7 @@ def verify_signature(signature, person) return false unless signature && person.key_fingerprint validity = nil + Rails.logger.info("Verifying sig on #{signable_string} from person #{person.real_name}") GPGME::verify(signature, signable_string, {:armor => true, :always_trust => true}){ |signature_analysis| puts signature_analysis @@ -31,6 +32,7 @@ end def sign_with_key(key) + Rails.logger.info("Signing #{signable_string} with key for person #{self.person.real_name}") GPGME::sign(signable_string,nil, {:armor=> true, :mode => GPGME::SIG_MODE_DETACH, :signers => [key]}) end