RS IZ added a logger statement and a guid in the webfinger profile
This commit is contained in:
parent
86d9a41d25
commit
522450c9d3
3 changed files with 6 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in a new issue