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

get signed?
This commit is contained in:
ilya 2010-08-17 18:06:28 -07:00
parent f15b3c46b2
commit daf08cd9f9
3 changed files with 29 additions and 6 deletions

View file

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

View file

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

View file

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