Skip to content
Extraits de code Groupes Projets
sockets_controller.rb 569 octets
Newer Older
  • Learn to ignore specific revisions
  • Raphael's avatar
    Raphael a validé
    #   Copyright (c) 2010, Diaspora Inc.  This file is
    
    Raphael's avatar
    Raphael a validé
    #   licensed under the Affero General Public License version 3 or later.  See
    
    Raphael's avatar
    Raphael a validé
    #   the COPYRIGHT file.
    
    class SocketsController < ApplicationController
    
      include ApplicationHelper
    
      include Rails.application.routes.url_helpers
    
    maxwell's avatar
    maxwell a validé
    
      def incoming(msg)
    
    ilya's avatar
    ilya a validé
        Rails.logger.info("Socket received connection to: #{msg}")
    
    maxwell's avatar
    maxwell a validé
      end
    
      def outgoing(user, object, opts={})
    
    maxwell's avatar
    maxwell a validé
        @_request = ActionDispatch::Request.new({})
    
        Diaspora::WebSocket.queue_to_user(user.id, action_hash(user, object, opts))
    
    maxwell's avatar
    maxwell a validé
      end
    end