mirror of
https://github.com/diaspora/diaspora.git
synced 2026-04-29 03:01:03 -04:00
MS kinda hacky webfinger email fix
This commit is contained in:
@@ -26,13 +26,16 @@ class RequestsController < ApplicationController
|
||||
|
||||
def create
|
||||
url = diaspora_url(params[:request][:destination_url])
|
||||
@request = current_user.send_friend_request_to(url)
|
||||
@request = current_user.send_friend_request_to(url) unless url.include?('@')
|
||||
if @request
|
||||
flash[:notice] = "a friend request was sent to #{@request.destination_url}"
|
||||
redirect_to requests_url
|
||||
else
|
||||
|
||||
flash[:error] = "you have already friended this person"
|
||||
if url.include? '@'
|
||||
flash[:error] = "no diaspora seed found with this email!"
|
||||
else
|
||||
flash[:error] = "you have already friended this person"
|
||||
end
|
||||
@request = Request.new
|
||||
render :action => 'new'
|
||||
end
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
module RequestsHelper
|
||||
def diaspora_url(identifier)
|
||||
if identifier.include? '@'
|
||||
f = Redfinger.finger(identifier)
|
||||
identifier = f.links.each{|x| return x.href if x.rel =='http://joindiaspora.com/seed_location'}
|
||||
|
||||
begin
|
||||
f = Redfinger.finger(identifier)
|
||||
good_links = f.links.map{|x| return x.href if x.rel =='http://joindiaspora.com/seed_location'}
|
||||
identifier = good_links.first unless good_links.first.nil?
|
||||
rescue
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
identifier
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -33,7 +33,7 @@ end
|
||||
|
||||
package :diaspora_dependencies do
|
||||
description 'random dependencies'
|
||||
apt %w(libxslt1.1 libxslt1-dev libxml2 libgpgme11-dev)
|
||||
apt %w(libxslt1.1 libxslt1-dev libxml2 libgpgme11-dev )
|
||||
end
|
||||
#package :diaspora do
|
||||
# description 'Diaspora'
|
||||
|
||||
Reference in New Issue
Block a user