Class: PublicsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- PublicsController
- Includes:
- Diaspora::Parser
- Defined in:
- app/controllers/publics_controller.rb
Overview
Copyright © 2010-2011, Diaspora Inc. This file is
licensed under the Affero General Public License version 3 or later. See
the COPYRIGHT file.
Instance Method Summary (collapse)
- - (Object) hcard
- - (Object) host_meta
- - (Object) hub
- - (Object) receive
- - (Object) receive_public
- - (Object) webfinger
Methods included from Diaspora::Parser
Instance Method Details
- (Object) hcard
20 21 22 23 24 25 26 27 28 |
# File 'app/controllers/publics_controller.rb', line 20 def hcard @person = Person.find_by_guid_and_closed_account(params[:guid], false) if @person.present? && @person.local? render 'publics/hcard' else render :nothing => true, :status => 404 end end |
- (Object) host_meta
30 31 32 |
# File 'app/controllers/publics_controller.rb', line 30 def render 'host_meta', :content_type => 'application/xrd+xml' end |
- (Object) hub
46 47 48 |
# File 'app/controllers/publics_controller.rb', line 46 def hub render :text => params['hub.challenge'], :status => 202, :layout => false end |
- (Object) receive
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'app/controllers/publics_controller.rb', line 56 def receive person = Person.find_by_guid(params[:guid]) if person.nil? || person.owner_id.nil? Rails.logger.error("Received post for nonexistent person #{params[:guid]}") render :nothing => true, :status => 404 return end @user = person.owner FEDERATION_LOGGER.info("recieved a private message for user:#{@user.id}") Workers::ReceiveEncryptedSalmon.perform_async(@user.id, CGI::unescape(params[:xml])) render :nothing => true, :status => 202 end |
- (Object) receive_public
50 51 52 53 54 |
# File 'app/controllers/publics_controller.rb', line 50 def receive_public FEDERATION_LOGGER.info("recieved a public message") Workers::ReceiveUnencryptedSalmon.perform_async(CGI::unescape(params[:xml])) render :nothing => true, :status => :ok end |
- (Object) webfinger
34 35 36 37 38 39 40 41 42 43 44 |
# File 'app/controllers/publics_controller.rb', line 34 def webfinger @person = Person.local_by_account_identifier(params[:q]) if params[:q] if @person.nil? || @person.closed_account? render :nothing => true, :status => 404 return end FEDERATION_LOGGER.info("webfinger profile request for :#{@person.id}") render 'webfinger', :content_type => 'application/xrd+xml' end |