Merge branch 'master' of github.com:diaspora/diaspora_rails
This commit is contained in:
commit
82e61ff99d
3 changed files with 6 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue