From 85e0736e5b289afaee913258a41da749fc543c89 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Mon, 21 Mar 2011 17:12:54 -0700 Subject: [PATCH] Remove stray puts --- app/controllers/services_controller.rb | 1 - lib/webfinger_profile.rb | 16 ++++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index d3cc5549e..ae855f4ae 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -47,7 +47,6 @@ class ServicesController < ApplicationController def finder service = current_user.services.where(:type => "Services::#{params[:provider].titleize}").first @friends = service ? service.finder(:remote => params[:remote]) : [] - pp @friends.class render :layout => false end diff --git a/lib/webfinger_profile.rb b/lib/webfinger_profile.rb index e843030f5..7b7a08fa9 100644 --- a/lib/webfinger_profile.rb +++ b/lib/webfinger_profile.rb @@ -7,7 +7,7 @@ class WebfingerProfile @links = {} set_fields end - + def valid_diaspora_profile? !(@webfinger_profile.nil? || @account.nil? || @links.nil? || @hcard.nil? || @guid.nil? || @public_key.nil? || @seed_location.nil? ) @@ -17,12 +17,12 @@ class WebfingerProfile def set_fields doc = Nokogiri::XML.parse(webfinger_profile) - + account_string = doc.css('Subject').text.gsub('acct:', '').strip - + raise "account in profile(#{account_string}) and account requested (#{@account}) do not match" if account_string != @account - doc.css('Link').each do |l| + doc.css('Link').each do |l| rel = text_of_attribute(l, 'rel') href = text_of_attribute(l, 'href') @links[rel] = href @@ -30,7 +30,7 @@ class WebfingerProfile when "http://microformats.org/profile/hcard" @hcard = href when "http://joindiaspora.com/guid" - @guid = href + @guid = href when "http://joindiaspora.com/seed_location" @seed_location = href end @@ -38,14 +38,14 @@ class WebfingerProfile if doc.at('Link[rel=diaspora-public-key]') begin - pubkey = text_of_attribute( doc.at('Link[rel=diaspora-public-key]'), 'href') + pubkey = text_of_attribute( doc.at('Link[rel=diaspora-public-key]'), 'href') @public_key = Base64.decode64 pubkey rescue Exception => e - puts "probally not diaspora..." + Rails.logger.info(:event => :invalid_profile, :identifier => @account) end end end - + def text_of_attribute(doc, attr) doc.attribute(attr) ? doc.attribute(attr).text : nil end