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

DG IZ posts by the user get websocketed on the group page and albums

get signed?
parent f15b3c46
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -22,6 +22,10 @@ module SocketsHelper
action_hash[:status_message_hash][:mine?] = true if object.person.owner_id == uid
end
if object.person.owner_id == uid
action_hash[:mine?] = true
end
action_hash.to_json
end
......
......@@ -3,6 +3,7 @@ class Album
include MongoMapper::Document
include ROXML
include Diaspora::Webhooks
include Encryptable
xml_reader :name
xml_reader :person, :as => Person
......@@ -42,6 +43,24 @@ class Album
p_photo ? p_photo : self.photos.sort(:created_at.desc).last
end
#ENCRYPTION
xml_accessor :creator_signature
key :creator_signature, String
def signable_accessors
accessors = self.class.roxml_attrs.collect{|definition|
definition.accessor}
accessors.delete 'person'
accessors.delete 'creator_signature'
accessors
end
def signable_string
signable_accessors.collect{|accessor|
(self.send accessor.to_sym).to_s}.join ';'
end
protected
def destroy_photos
photos.each{|p| p.destroy}
......
......@@ -23,9 +23,9 @@
}else if (obj['class']=='photos' && onPageForClass('albums')){
processPhotoInAlbum(obj['photo_hash'])
}else if (obj['class']=='status_messages'){
processStatusMessage(obj['class'], obj['html'], obj['status_message_hash'], obj['group_id'])
processStatusMessage(obj['class'], obj['html'], obj['status_message_hash'], obj['group_id'], obj['mine?'])
}else{
processPost(obj['class'], obj['html'], obj['group_id'])
processPost(obj['class'], obj['html'], obj['group_id'], obj['mine?'])
}
......@@ -52,8 +52,8 @@
toggler.html().replace(/\d/,$('.comment_set', post)[0].childElementCount -1));
}
function processPost(className, html, groupId){
if(onPageForClass(className) || onPageForGroup(groupId)){
function processPost(className, html, groupId, mineBool){
if(mineBool || onPageForClass(className) || onPageForGroup(groupId)){
$("#stream").prepend(
$(html).fadeIn("fast", function(){
$("#stream label:first").inFieldLabels();
......@@ -62,8 +62,8 @@
}
}
function processStatusMessage(className, html, messageHash, groupId){
processPost(className, html, groupId);
function processStatusMessage(className, html, messageHash, groupId, mineBool){
processPost(className, html, groupId, mineBool);
console.log(messageHash)
if(messageHash['mine?']){
updateMyLatestStatus(messageHash);
......
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