Class: Vines::Services::Controller::SubscriptionsController

Inherits:
BaseController
  • Object
show all
Defined in:
lib/vines/services/controller/subscriptions_controller.rb

Overview

Presence subscription requests are approved if the user has privilege to access the requested service JID. All subscriptions to the component itself are approved.

Instance Attribute Summary

Attributes inherited from BaseController

#node, #storage, #stream, #uploads

Instance Method Summary collapse

Methods inherited from BaseController

#initialize, register

Constructor Details

This class inherits a constructor from Vines::Services::Controller::BaseController

Instance Method Details

#processObject



12
13
14
15
16
17
18
19
20
# File 'lib/vines/services/controller/subscriptions_controller.rb', line 12

def process
  if approved?
    from, to = node.from.stripped, node.to.stripped
    stream.write(node.approve!)
    stream.write(available(to, from))
  else
    stream.write(node.refuse!)
  end
end