MS IZ getting the profile
This commit is contained in:
parent
58b052b07f
commit
f34e033bce
5 changed files with 23 additions and 20 deletions
|
|
@ -23,7 +23,6 @@ class RequestsController < ApplicationController
|
||||||
def new
|
def new
|
||||||
@request = Request.new
|
@request = Request.new
|
||||||
end
|
end
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
def create
|
def create
|
||||||
url = find_url(params)
|
url = find_url(params)
|
||||||
|
|
@ -39,16 +38,16 @@ require 'spec_helper'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def diasproa_url(url)
|
def self.diasproa_url(identifier)
|
||||||
if url.include? '@'
|
if identifier.include? '@'
|
||||||
f = Redfinger.finger(uri)
|
f = Redfinger.finger(uri)
|
||||||
url
|
identifier = f.each{|x| return x.link if x.rel =='http://joindiaspora.com/seed_location'}
|
||||||
end
|
end
|
||||||
|
identifier
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,10 @@
|
||||||
module RequestsHelper
|
module RequestsHelper
|
||||||
|
def diaspora_url(identifier)
|
||||||
|
if identifier.include? '@'
|
||||||
|
f = Redfinger.finger(identifier)
|
||||||
|
identifier = f.each{|x| return x.link if x.rel =='http://joindiaspora.com/seed_location'}
|
||||||
|
end
|
||||||
|
identifier
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -4,5 +4,5 @@
|
||||||
<Alias>"<%=@user.url%>hcard"</Alias>
|
<Alias>"<%=@user.url%>hcard"</Alias>
|
||||||
<Link rel="http://microformats.org/profile/hcard" type="text/html" href="<%=@user.url%>hcard"/>
|
<Link rel="http://microformats.org/profile/hcard" type="text/html" href="<%=@user.url%>hcard"/>
|
||||||
<Link rel="http://schemas.google.com/g/2010#updates-from" type="application/atom+xml" href="<%=@user.url%>status_messages.atom"/>
|
<Link rel="http://schemas.google.com/g/2010#updates-from" type="application/atom+xml" href="<%=@user.url%>status_messages.atom"/>
|
||||||
<Link rel="http://joindiaspora.com/location" type = 'text/html' href="<%=@user.url%>
|
<Link rel="http://joindiaspora.com/seed_location" type = 'text/html' href="<%=@user.url%>"/>
|
||||||
</XRD>
|
</XRD>
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
describe 'webfinger' do
|
|
||||||
redner_views
|
|
||||||
|
|
||||||
describe "profile" do
|
|
||||||
it 'should fetch the public webfinger profile on request' do
|
|
||||||
post
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
@ -1,11 +1,16 @@
|
||||||
require 'spec_helper'
|
require File.dirname(__FILE__) + '/../spec_helper'
|
||||||
|
|
||||||
describe RequestsController do
|
describe RequestsController do
|
||||||
redner_views
|
|
||||||
|
|
||||||
describe "profile" do
|
describe "profile" do
|
||||||
it 'should fetch the public webfinger profile on request' do
|
it 'should fetch the public webfinger profile on request' do
|
||||||
post
|
#post :create {:request => {:destination_url => 'tom@tom.joindiaspora.com'}
|
||||||
|
|
||||||
|
url = RequestsController.diaspora_url('http://tom.joindiasproa.com')
|
||||||
|
url.should == 'htto://tom.joindiaspora.com'
|
||||||
|
|
||||||
|
|
||||||
|
url = RequestsController.diaspora_url('tom@tom.joindiaspora.com')
|
||||||
|
url.should == 'http://tom.joindiaspora.com'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue