Class: DiasporaFederation::ReceiveController

Inherits:
ApplicationController show all
Defined in:
app/controllers/diaspora_federation/receive_controller.rb

Overview

This controller processes receiving messages.

Instance Method Summary collapse

Methods inherited from ApplicationController

#set_locale

Instance Method Details

#privateObject

Receives private messages for a user

POST /receive/users/:guid



25
26
27
28
29
30
31
32
# File 'app/controllers/diaspora_federation/receive_controller.rb', line 25

def private
  data = request.body.read
  logger.debug data

  success = DiasporaFederation.callbacks.trigger(:queue_private_receive, params[:guid], data)

  head success ? :accepted : :not_found
end

#publicObject

Receives public messages

POST /receive/public



13
14
15
16
17
18
19
20
# File 'app/controllers/diaspora_federation/receive_controller.rb', line 13

def public
  data = request.body.read
  logger.debug data

  DiasporaFederation.callbacks.trigger(:queue_public_receive, data)

  head :accepted
end