about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-04-04 20:16:14 -0400
committerDrew DeVault <sir@cmpwn.com>2017-04-04 20:52:31 -0400
commitf7e35d90db3a08dbb4e4104f513e5817e18659b9 (patch)
treed23cf8abfed09ec0b8c58f484b007ed4deeb8cb7 /app/controllers
parentbda37489ac5c14d18b1bb4290f2a2931dc8728c9 (diff)
Remote follow improvements
This stores the @username@instance you provide in your session and
reuses it the next time you remote follow someone from this instance.
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/remote_follow_controller.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/controllers/remote_follow_controller.rb b/app/controllers/remote_follow_controller.rb
index 7d4bfe6ce..1e3f786ec 100644
--- a/app/controllers/remote_follow_controller.rb
+++ b/app/controllers/remote_follow_controller.rb
@@ -8,6 +8,7 @@ class RemoteFollowController < ApplicationController
 
   def new
     @remote_follow = RemoteFollow.new
+    @remote_follow.acct = session[:remote_follow] if session.key?(:remote_follow)
   end
 
   def create
@@ -22,6 +23,8 @@ class RemoteFollowController < ApplicationController
         render(:new) && return
       end
 
+      session[:remote_follow] = @remote_follow.acct
+
       redirect_to Addressable::Template.new(redirect_url_link.template).expand(uri: "#{@account.username}@#{Rails.configuration.x.local_domain}").to_s
     else
       render :new