Sha256: 73c4f7cdd765f4f218c45308479a2e2fdcd83342a77041acfd67f4f9e6c6cd5e

Contents?: true

Size: 865 Bytes

Versions: 43

Compression:

Stored size: 865 Bytes

Contents

class PshbController < ApplicationController
  include SocialStream::Ostatus::Controllers::DebugRequests

  skip_before_filter :verify_authenticity_token

  def index
    case params['hub.mode']
    #TODO check PuSH specification about subscribe or async
    when 'subscribe', 'async'
      render :text => params['hub.challenge'], :status => 200
      # TODO: confirm that params['hub.topic'] is a real 
      # requested subscription by someone in this node
      return
    when 'unsubscribe'
      render :text => params['hub.challenge'], :status => 200
      # TODO: confirm that params['hub.topic'] is a real 
      # requested unsubscription by someone in this node
      # and delete permissions/remote actor if necessary
      return
    end  

    SocialStream::ActivityStreams.from_pshb_callback(request.body.read)

    render text: "Success!"
  end
end

Version data entries

43 entries across 43 versions & 2 rubygems

Version Path
social_stream-2.2.2 ostatus/app/controllers/pshb_controller.rb
social_stream-ostatus-2.2.1 app/controllers/pshb_controller.rb
social_stream-2.2.1 ostatus/app/controllers/pshb_controller.rb
social_stream-2.2.0 ostatus/app/controllers/pshb_controller.rb
social_stream-ostatus-2.2.0 app/controllers/pshb_controller.rb
social_stream-2.1.1 ostatus/app/controllers/pshb_controller.rb
social_stream-1.1.12 ostatus/app/controllers/pshb_controller.rb
social_stream-2.1.0 ostatus/app/controllers/pshb_controller.rb
social_stream-ostatus-2.1.0 app/controllers/pshb_controller.rb
social_stream-2.0.4 ostatus/app/controllers/pshb_controller.rb
social_stream-2.0.3 ostatus/app/controllers/pshb_controller.rb
social_stream-1.1.11 ostatus/app/controllers/pshb_controller.rb
social_stream-1.1.10 ostatus/app/controllers/pshb_controller.rb
social_stream-1.1.9 ostatus/app/controllers/pshb_controller.rb
social_stream-ostatus-1.1.1 app/controllers/pshb_controller.rb
social_stream-1.1.8 ostatus/app/controllers/pshb_controller.rb
social_stream-2.0.2 ostatus/app/controllers/pshb_controller.rb
social_stream-2.0.1 ostatus/app/controllers/pshb_controller.rb
social_stream-2.0.0 ostatus/app/controllers/pshb_controller.rb
social_stream-ostatus-2.0.0 app/controllers/pshb_controller.rb