DG IZ using group_id when passing the id around the app
This commit is contained in:
parent
87bc9dad1d
commit
7d68089c8b
4 changed files with 7 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue