diff --git a/app/controllers/sockets_controller.rb b/app/controllers/sockets_controller.rb index ab6a70109..cdb2b5c2e 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 00c57959b..9fa8f2f74 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 fd4789bb6..5e6777a23 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 36f8bf9c5..d3ca511bb 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