diff --git a/app/models/person.rb b/app/models/person.rb index e3a2dd5daa41733c055e86fefa9a7de383a912c1..3fca21eb2617add354c60d500d1d7fb86a9feef9 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -94,12 +94,14 @@ class Person public_key = profile.links.select{|x| x.rel == 'diaspora-public-key'}.first.href new_person.exported_key = Base64.decode64 public_key + + guid = profile.links.select{|x| x.rel == 'diaspora-public-key'}.first.href + new_person.id = guid new_person.email = identifier hcard = HCard.find profile.hcard.first[:href] - receive_url = profile.links.select{ |l| l.rel == 'http://joindiaspora.com/seed_location'}.first.href new_person.url = hcard[:url] new_person.profile = Profile.new(:first_name => hcard[:given_name], :last_name => hcard[:family_name]) if new_person.save diff --git a/app/models/user.rb b/app/models/user.rb index 45eae6bad42481deba0b988e24918c4d1e4c8fd0..d4408674efe693a95f8c0696988d30f3a9e942e4 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -204,6 +204,7 @@ class User ###### Receiving ####### def receive_salmon xml + Rails.logger.info("Received a salmon: #{xml}") salmon = Salmon::SalmonSlap.parse xml if salmon.verified_for_key?(salmon.author.public_key) self.receive(decrypt(salmon.data)) diff --git a/app/views/publics/webfinger.erb b/app/views/publics/webfinger.erb index f05590ea9122d3d380eb52087c66c5ecbc627e34..75a2e9fe836627d7d4b11968250db8585ffa5116 100644 --- a/app/views/publics/webfinger.erb +++ b/app/views/publics/webfinger.erb @@ -4,6 +4,7 @@ <Alias>"<%= @person.url %>"</Alias> <Link rel="http://microformats.org/profile/hcard" type="text/html" href="<%=@person.url%>/hcard/users/<%=@person.id%>"/> <Link rel="http://schemas.google.com/g/2010#updates-from" type="application/atom+xml" href="<%=@person.url%>status_messages.atom"/> - <Link rel="http://joindiaspora.com/seed_location" type = 'text/html' href="<%=@person.receive_url%>"/> + <Link rel="http://joindiaspora.com/seed_location" type = 'text/html' href="<%=@person.url%>"/> + <Link rel="http://joindiaspora.com/guid" type = 'text/html' href="<%=@person.id%>"/> <Link rel="diaspora-public-key" type = 'RSA' href="<%=Base64.encode64(@person.exported_key)%>"/> </XRD>