added Link to profile page in webfinger profile to make federation a bit easier

This commit is contained in:
Maxwell Salzberg 2011-08-31 19:57:46 -07:00
parent 62aea0e820
commit b8ca4bfcab
4 changed files with 11 additions and 15 deletions

View file

@ -51,14 +51,16 @@ module PeopleHelper
end
end
def person_href(person)
def person_href(person, opts={})
link = "href='"
link += AppConfig.pod_url if opts[:absolute]
if person.local?
username = person.diaspora_handle.split('@')[0]
unless username.include?('.')
return "href='/u/#{person.diaspora_handle.split('@')[0]}'"
return link+"u/#{person.diaspora_handle.split('@')[0]}'"
end
end
return "href='/people/#{person.id}'"
return link+"people/#{person.id}'"
end
end

View file

@ -6,6 +6,7 @@
<Link rel="http://joindiaspora.com/seed_location" type = 'text/html' href="<%=@person.url%>"/>
<Link rel="http://joindiaspora.com/guid" type = 'text/html' href="<%=@person.guid%>"/>
<Link rel='http://webfinger.net/rel/profile-page' type='text/html' <%="#{person_href(@person, :absolute => true)}"%>/>
<Link rel="http://schemas.google.com/g/2010#updates-from" type="application/atom+xml" href="<%=@person.public_url%>.atom"/>
<Link rel="diaspora-public-key" type = 'RSA' href="<%=Base64.encode64(@person.exported_key)%>"/>

View file

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
<Subject>acct:<%=@person.diaspora_handle%></Subject>
<Alias>"<%= @person.url %>"</Alias>
<Link rel="http://microformats.org/profile/hcard" type="text/html" href="<%=@person.url%>hcard/users/<%=@person.guid%>"/>
<Link rel="http://joindiaspora.com/seed_location" type = 'text/html' href="<%=@person.url%>"/>
<Link rel="http://joindiaspora.com/guid" type = 'text/html' href="<%=@person.guid%>"/>
<Link rel="http://schemas.google.com/g/2010#updates-from" type="application/atom+xml" href="<%=@person.public_url%>.atom"/>
<Link rel="diaspora-public-key" type = 'RSA' href="<%=Base64.encode64(@person.exported_key)%>"/>
</XRD>

View file

@ -103,6 +103,11 @@ describe PublicsController do
post :webfinger, 'q' => 'me@mydiaspora.pod.com'
response.should be_not_found
end
it 'has the users profile href' do
get :webfinger, :q => @user.diaspora_handle
response.body.should include "http://webfinger.net/rel/profile-page"
end
end
describe '#hub' do