config/initializers/events.rb
9006a1f6
 WebsocketRails.setup do |config|
 
   # Uncomment to override the default log level. The log level can be
   # any of the standard Logger log levels. By default it will mirror the
   # current Rails environment log level.
   # config.log_level = :debug
 
   # Uncomment to change the default log file path.
   # config.log_path = "#{Rails.root}/log/websocket_rails.log"
 
   # Set to true if you wish to log the internal websocket_rails events
   # such as the keepalive `websocket_rails.ping` event.
   # config.log_internal_events = false
 
   # Change to true to enable standalone server mode
   # Start the standalone server with rake websocket_rails:start_server
   # * Requires Redis
   config.standalone = false
 
   # Change to true to enable channel synchronization between
   # multiple server instances.
   # * Requires Redis.
   config.synchronize = false
 
   # Uncomment and edit to point to a different redis instance.
   # Will not be used unless standalone or synchronization mode
   # is enabled.
   # config.redis_options = {:host => 'localhost', :port => '6379'}
 end
 
 WebsocketRails::EventMap.describe do
   # You can use this file to map incoming events to controller actions.
   # One event can be mapped to any number of controller actions. The
   # actions will be executed in the order they were subscribed.
   #
   # Uncomment and edit the next line to handle the client connected event:
   #   subscribe :client_connected, :to => Controller, :with_method => :method_name
   #
   # Here is an example of mapping namespaced events:
   #   namespace :product do
   #     subscribe :new, :to => ProductController, :with_method => :new_product
   #   end
   # The above will handle an event triggered on the client like `product.new`.
ff94bdbf
 
52ef7688
     #toto asi poide do nadtriedy spajajucej roster a chat a ine veci
24b129a9
     subscribe :client_connected,    to: WsRosterController, with_method: :connect
b27f285a
     subscribe :client_disconnected, to: WsRosterController, with_method: :disconnect
 
ff94bdbf
     namespace :app do
 
         namespace :roster do
52ef7688
             subscribe :initRoster,          to: WsRosterController, with_method: :init_roster
             subscribe :startFetchingVcards, to: WsRosterController, with_method: :start_fetching_vcards
             subscribe :startPolling,        to: WsRosterController, with_method: :start_polling_contacts_state
43ad79fa
             subscribe :setPresence,         to: WsRosterController, with_method: :set_presence
d4872cda
             subscribe :myself,              to: WsRosterController, with_method: :myself
c4a1e746
             subscribe :updateMyStatus,      to: WsRosterController, with_method: :me_update_status
             subscribe :updateMyVcard,       to: WsRosterController, with_method: :me_update_vcard
635339a3
             subscribe :removeContact,       to: WsRosterController, with_method: :remove_contact
ff94bdbf
         end
 
424fd46f
         namespace :chat do
24b129a9
             subscribe :newMultiChatId,        to: WsChatController, with_method: :new_multichat
             subscribe :addToMultiChat,        to: WsChatController, with_method: :add_to_multichat
             subscribe :sendMessage,           to: WsChatController, with_method: :send_chat_message
             subscribe :startPollingMessages,  to: WsChatController, with_method: :start_polling_messages
             subscribe :syncMultiChatContacts, to: WsChatController, with_method: :sync_chat_contacts
424fd46f
         end
ff94bdbf
     end
9006a1f6
 end