Skip to content
Extraits de code Groupes Projets
Valider 4c731bf8 rédigé par Raphael's avatar Raphael
Parcourir les fichiers

special-casing local webfinger

parent 6ae4c31e
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -15,7 +15,7 @@ class PublicsController < ApplicationController
end
def webfinger
@person = Person.first(:email => params[:q].gsub('acct:', ''))
@person = Person.by_webfinger(params[:q])
unless @person.nil? || @person.owner.nil?
render 'webfinger', :layout => false, :content_type => 'application/xrd+xml'
end
......
......@@ -26,9 +26,16 @@ module RequestsHelper
end
def relationship_flow(identifier)
f = Redfinger.finger(identifier)
action = subscription_mode(f)
url = subscription_url(action, f)
puts request.host
if identifier.include?(request.host)
person = Person.by_webfinger identifier
action = :friend
url = person.owner.receive_url
else
f = Redfinger.finger(identifier)
action = subscription_mode(f)
url = subscription_url(action, f)
end
{ action => url }
end
......
......@@ -75,7 +75,7 @@ class Person
false
end
def send_comment c
def send_comment( c )
if self.owner.nil?
if c.post.person.owner.nil?
#puts "The commenter is not here, and neither is the poster"
......@@ -112,6 +112,10 @@ class Person
"#{self.url}receive/users/#{self.id}/"
end
def self.by_webfinger( identifier )
Person.first(:email => identifier.gsub('acct:', ''))
end
protected
def clean_url
self.url ||= "http://localhost:3000/" if self.class == User
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter