Skip to content
Extraits de code Groupes Projets
Valider 7d68089c rédigé par ilya's avatar ilya
Parcourir les fichiers

DG IZ using group_id when passing the id around the app

parent 87bc9dad
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter