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

This commit is contained in:
Raphael 2010-10-07 09:37:00 -07:00
commit b6a3549693
3 changed files with 3 additions and 8 deletions

View file

@ -50,7 +50,7 @@ class Person
end end
def public_url def public_url
"#{self.url}users/#{self.owner.username}" "#{self.url}public/#{self.owner.username}"
end end

View file

@ -11,7 +11,7 @@ Diaspora::Application.routes.draw do
resources :albums resources :albums
# added public route to user # added public route to user
match 'users/:username', :to => 'users#public' match 'public/:username', :to => 'users#public'
resources :users, :except => [:create, :new, :show] resources :users, :except => [:create, :new, :show]
match 'aspects/move_friends', :to => 'aspects#move_friends', :as => 'move_friends' match 'aspects/move_friends', :to => 'aspects#move_friends', :as => 'move_friends'

View file

@ -63,6 +63,7 @@ module Salmon
### Header ## ### Header ##
decrypted_header = user.decrypt(doc.search('encrypted_header').text) decrypted_header = user.decrypt(doc.search('encrypted_header').text)
header_doc = Nokogiri::XML(decrypted_header) header_doc = Nokogiri::XML(decrypted_header)
slap.author_email= header_doc.search('uri').text.split("acct:").last
slap.aes_key = header_doc.search('aes_key').text slap.aes_key = header_doc.search('aes_key').text
slap.iv = header_doc.search('iv').text slap.iv = header_doc.search('iv').text
@ -81,8 +82,6 @@ module Salmon
raise ArgumentError, "Magic Signature data must be signed with RSA-SHA256, was #{slap.magic_sig.alg}" unless 'RSA-SHA256' == slap.magic_sig.alg raise ArgumentError, "Magic Signature data must be signed with RSA-SHA256, was #{slap.magic_sig.alg}" unless 'RSA-SHA256' == slap.magic_sig.alg
uri = doc.search('uri').text
slap.author_email = uri.split("acct:").last
slap slap
end end
@ -91,10 +90,6 @@ module Salmon
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<entry xmlns='http://www.w3.org/2005/Atom'> <entry xmlns='http://www.w3.org/2005/Atom'>
<encrypted_header>#{person.encrypt(decrypted_header)}</encrypted_header> <encrypted_header>#{person.encrypt(decrypted_header)}</encrypted_header>
<author>
<name>#{@author.real_name}</name>
<uri>acct:#{@author.diaspora_handle}</uri>
</author>
#{@magic_sig.to_xml} #{@magic_sig.to_xml}
</entry> </entry>
ENTRY ENTRY