diff --git a/public/javascripts/app/views/content_view.js b/public/javascripts/app/views/content_view.js index abc66b7813f41b114e8a8eaa830c7f21aa12fa0a..0287b7bf335497d183f692c4072201f1eb40e87d 100644 --- a/public/javascripts/app/views/content_view.js +++ b/public/javascripts/app/views/content_view.js @@ -1,14 +1,12 @@ app.views.Content = app.views.StreamObject.extend({ presenter : function(model){ var model = model || this.model - console.log(model.get("author")) return _.extend(this.defaultPresenter(), { text : app.helpers.textFormatter(model), o_embed_html : embedHTML(model), largePhoto : this.largePhoto(model), - smallPhotos : this.smallPhotos(model), - root : this.rootPresenter(model) + smallPhotos : this.smallPhotos(model) }) function embedHTML(model){ diff --git a/public/javascripts/app/views/feedback_view.js b/public/javascripts/app/views/feedback_view.js index 3337906ed40fe2958b7d6c56f7cde99b8bd9de50..b63e1781e6c895f61609ad980f45bffa694c11c6 100644 --- a/public/javascripts/app/views/feedback_view.js +++ b/public/javascripts/app/views/feedback_view.js @@ -33,10 +33,13 @@ app.views.Feedback = app.views.StreamObject.extend({ }, userCanReshare : function() { + var isReshare = this.model.get("post_type") == "Reshare" + var rootExists = (isReshare ? this.model.get("root") : true) + var publicPost = this.model.get("public"); - var userIsNotAuthor = this.model.get("author").id != app.user().id; - var rootExists = (this.model.get("post_type") == "Reshare" ? this.model.get("root") : true); - - return publicPost && userIsNotAuthor && rootExists; + var userIsNotAuthor = this.model.get("author").diaspora_id != app.user().diaspora_id; + var userIsNotRootAuthor = rootExists && (isReshare ? this.model.get("root").author.diaspora_id != app.user().diaspora_id : true) + + return publicPost && userIsNotAuthor && userIsNotRootAuthor; } })