diff --git a/app/controllers/sockets_controller.rb b/app/controllers/sockets_controller.rb index ab6a701092525738a6e8450acc0ba1ea742cba21..cdb2b5c2eab870ed9601e16eb5d21aca2bc461a2 100644 --- a/app/controllers/sockets_controller.rb +++ b/app/controllers/sockets_controller.rb @@ -9,7 +9,7 @@ class SocketsController < ApplicationController def outgoing(uid,object,opts={}) @_request = ActionDispatch::Request.new({}) - Diaspora::WebSocket.push_to_user(uid, action_hash(uid, object)) + Diaspora::WebSocket.push_to_user(uid, action_hash(uid, object, :group_id => opts[:group_id])) end end diff --git a/app/helpers/sockets_helper.rb b/app/helpers/sockets_helper.rb index 00c57959bd0b03a5c32c99983dbd2324577b9ae8..9fa8f2f74632b294e835e1f3c97b15b30dd33094 100644 --- a/app/helpers/sockets_helper.rb +++ b/app/helpers/sockets_helper.rb @@ -13,7 +13,7 @@ module SocketsHelper Rails.logger.error("web socket view rendering failed for object #{object.inspect}.") raise e end - action_hash = {:class =>object.class.to_s.underscore.pluralize, :group => opts[:group] , :html => v, :post_id => obj_id(object)} + action_hash = {:class =>object.class.to_s.underscore.pluralize, :group_id => opts[:group_id] , :html => v, :post_id => obj_id(object)} if object.is_a? Photo action_hash[:photo_hash] = object.thumb_hash diff --git a/app/views/js/_websocket_js.haml b/app/views/js/_websocket_js.haml index fd4789bb6f742b441bf930cdf5d1677bb4a927a0..5e6777a234c21a81949d98900302a92409f97025 100644 --- a/app/views/js/_websocket_js.haml +++ b/app/views/js/_websocket_js.haml @@ -12,7 +12,7 @@ //Attach onmessage to websocket ws.onmessage = function(evt) { var obj = jQuery.parseJSON(evt.data); - debug("got a " + obj['class'] + 'for group' + obj['group']); + debug("got a " + obj['class'] + " for group " + obj['group']); if (obj['class']=="retractions"){ processRetraction(obj['post_id']); @@ -62,8 +62,8 @@ } } - function processStatusMessage(className, html, messageHash, group_id){ - processPost(className, html, group_id); + function processStatusMessage(className, html, messageHash, groupId){ + processPost(className, html, groupId); console.log(messageHash) if(messageHash['mine?']){ updateMyLatestStatus(messageHash); @@ -94,7 +94,7 @@ } function onPageForGroup(groupId){ - alert( groupId); + alert( groupId ); } function onPageOne() { diff --git a/lib/diaspora/websocket.rb b/lib/diaspora/websocket.rb index 36f8bf9c5f7daa51185c340fd8a970cb199808e8..d3ca511bbe576038e1b870b2ec0479d1f8e09889 100644 --- a/lib/diaspora/websocket.rb +++ b/lib/diaspora/websocket.rb @@ -32,7 +32,7 @@ module Diaspora module Socketable def socket_to_uid(id, opts={}) - SocketsController.new.outgoing(id, self, :group => opts[:group_id]) + SocketsController.new.outgoing(id, self, :group_id => opts[:group_id]) end def unsocket_from_uid id