Merge branch 'master' of github.com:diaspora/diaspora_rails

This commit is contained in:
maxwell 2010-07-22 13:53:46 -07:00
commit 82e61ff99d
3 changed files with 6 additions and 3 deletions

View file

@ -3,7 +3,7 @@ class Photo < Post
include MongoMapper::Document include MongoMapper::Document
mount_uploader :image, ImageUploader mount_uploader :image, ImageUploader
xml_reader :remote_photo xml_accessor :remote_photo
xml_reader :album_id xml_reader :album_id
key :album_id, ObjectId key :album_id, ObjectId
@ -23,10 +23,11 @@ class Photo < Post
end end
def remote_photo def remote_photo
User.owner.url.chop + image.url @remote_photo ||= User.owner.url.chop + image.url
end end
def remote_photo= remote_path def remote_photo= remote_path
@remote_photo = remote_path
image.download! remote_path image.download! remote_path
image.store! image.store!
end end

View file

@ -51,7 +51,7 @@ module Diaspora
User.owner.receive_friend_request(p) User.owner.receive_friend_request(p)
#This line checks if the sender was in the database, among other things? #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 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 end
#p.save if p.respond_to?(:person) && !(p.person == nil) #WTF #p.save if p.respond_to?(:person) && !(p.person == nil) #WTF
end end

View file

@ -10,6 +10,7 @@
def verify_signature(signature, person) def verify_signature(signature, person)
return false unless signature && person.key_fingerprint return false unless signature && person.key_fingerprint
validity = nil validity = nil
Rails.logger.info("Verifying sig on #{signable_string} from person #{person.real_name}")
GPGME::verify(signature, signable_string, GPGME::verify(signature, signable_string,
{:armor => true, :always_trust => true}){ |signature_analysis| {:armor => true, :always_trust => true}){ |signature_analysis|
puts signature_analysis puts signature_analysis
@ -31,6 +32,7 @@
end end
def sign_with_key(key) def sign_with_key(key)
Rails.logger.info("Signing #{signable_string} with key for person #{self.person.real_name}")
GPGME::sign(signable_string,nil, GPGME::sign(signable_string,nil,
{:armor=> true, :mode => GPGME::SIG_MODE_DETACH, :signers => [key]}) {:armor=> true, :mode => GPGME::SIG_MODE_DETACH, :signers => [key]})
end end