diff options
Diffstat (limited to 'users/app')
-rw-r--r-- | users/app/controllers/webfinger_controller.rb | 4 | ||||
-rw-r--r-- | users/app/views/webfinger/search.xml.erb | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/users/app/controllers/webfinger_controller.rb b/users/app/controllers/webfinger_controller.rb index f28dd3e..8872802 100644 --- a/users/app/controllers/webfinger_controller.rb +++ b/users/app/controllers/webfinger_controller.rb @@ -12,8 +12,8 @@ class WebfingerController < ApplicationController username = params[:q].split('@')[0].to_s.downcase user = User.find_by_login(username) raise RECORD_NOT_FOUND, 'User not found' unless user.present? - @subject = Webfinger::UserPresenter.new(user, request) - respond_with @subject + @presenter = Webfinger::UserPresenter.new(user, request) + respond_with @presenter end end diff --git a/users/app/views/webfinger/search.xml.erb b/users/app/views/webfinger/search.xml.erb index 270383e..27f26d1 100644 --- a/users/app/views/webfinger/search.xml.erb +++ b/users/app/views/webfinger/search.xml.erb @@ -1,8 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0"> - <Subject>acct:<%= @subject.email_identifier %></Subject> - <Alias>"<%= user_url(@subject.subject) %>"</Alias> - <%- if @subject.key.present? %> - <Link rel="public-key" type = 'PGP' href="<%= @subject.key %>"/> + <Subject><%= @presenter.subject %></Subject> + <%- @presenter.aliases.each do |user_alias| %> + <Alias>"<%= user_alias %>"</Alias> + <% end %> + <%- @presenter.links.each do |rel, link| %> + <Link rel=<%=rel%> type=<%=link[:type]%> href="<%= link[:key] %>"/> <% end %> </XRD> |