diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 95aabbf1b..0277fa88f 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -30,7 +30,18 @@ class PeopleController < ApplicationController render :json => @people end - format.all do + format.html do + #only do it if it is an email address + if params[:q].try(:match, Devise.email_regexp) + people = Person.where(:diaspora_handle => params[:q]) + webfinger(params[:q]) if people.empty? + else + people = Person.search(params[:q], current_user) + end + @people = people.paginate( :page => params[:page], :per_page => 15) + @hashes = hashes_for_people(@people, @aspects) + end + format.mobile do #only do it if it is an email address if params[:q].try(:match, Devise.email_regexp) people = Person.where(:diaspora_handle => params[:q]) @@ -68,7 +79,7 @@ class PeopleController < ApplicationController @person = Person.find_from_id_or_username(params) if remote_profile_with_no_user_session? - raise ActiveRecord::RecordNotFound + raise ActiveRecord::RecordNotFound end @post_type = :all