webfinger is now not washington specific
This commit is contained in:
parent
99f7e938fd
commit
3d87c111df
3 changed files with 14 additions and 1 deletions
|
|
@ -80,6 +80,13 @@ class User < Person
|
||||||
def mine?(post)
|
def mine?(post)
|
||||||
self == post.person
|
self == post.person
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def terse_url
|
||||||
|
terse= self.url.gsub(/https?:\/\//, '')
|
||||||
|
terse.gsub!(/www\./, '')
|
||||||
|
terse = terse.chop! if terse[-1, 1] == '/'
|
||||||
|
terse
|
||||||
|
end
|
||||||
|
|
||||||
def do_bad_things
|
def do_bad_things
|
||||||
self.password_confirmation = self.password
|
self.password_confirmation = self.password
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'
|
<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'
|
||||||
xmlns:hm='http://host-meta.net/xrd/1.0'>
|
xmlns:hm='http://host-meta.net/xrd/1.0'>
|
||||||
<hm:Host>washington.joindiaspora.com</hm:Host>
|
<hm:Host><%= @user.terse_url %></hm:Host>
|
||||||
<Link rel='lrdd'
|
<Link rel='lrdd'
|
||||||
template='<%=@user.url%>webfinger?q={uri}'>
|
template='<%=@user.url%>webfinger?q={uri}'>
|
||||||
<Title>Resource Descriptor</Title>
|
<Title>Resource Descriptor</Title>
|
||||||
|
|
|
||||||
|
|
@ -41,4 +41,10 @@ describe User do
|
||||||
@user.send_friend_request_to( @friend.url ).should be nil
|
@user.send_friend_request_to( @friend.url ).should be nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
it 'should be able to give me the terse url for webfinger' do
|
||||||
|
user = Factory.create(:user)
|
||||||
|
user.terse_url.should == 'example.com'
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue