Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorSteffen van Bergerem <svbergerem@online.de>2014-10-04 03:14:42 +0400
committerSteffen van Bergerem <svbergerem@online.de>2014-10-10 05:12:07 +0400
commit8ca5ca7c92bc3960bce80c17b1fb33aa724bfdff (patch)
tree376f03fdb0549324a0243c78b13a5ec116679513 /app
parentd44300c7a2b7bc8bd33ab880134695d0dc75d490 (diff)
Reshare the absolute root of a post
Diffstat (limited to 'app')
-rw-r--r--app/controllers/reshares_controller.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/controllers/reshares_controller.rb b/app/controllers/reshares_controller.rb
index 7fc4e815f..1e49a5aa0 100644
--- a/app/controllers/reshares_controller.rb
+++ b/app/controllers/reshares_controller.rb
@@ -3,7 +3,13 @@ class ResharesController < ApplicationController
respond_to :json
def create
- @reshare = current_user.build_post(:reshare, :root_guid => params[:root_guid])
+ post = Post.where(:guid => params[:root_guid]).first
+ if post.is_a? Reshare
+ @reshare = current_user.build_post(:reshare, :root_guid => post.absolute_root.guid)
+ else
+ @reshare = current_user.build_post(:reshare, :root_guid => params[:root_guid])
+ end
+
if @reshare.save
current_user.add_to_streams(@reshare, current_user.aspects)
current_user.dispatch_post(@reshare, :url => post_url(@reshare), :additional_subscribers => @reshare.root_author)