DG IZ using group_id when passing the id around the app

This commit is contained in:
ilya 2010-08-17 16:02:12 -07:00
parent 87bc9dad1d
commit 7d68089c8b
4 changed files with 7 additions and 7 deletions

View file

@ -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

View file

@ -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

View file

@ -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() {

View file

@ -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