From 932b0b2f1f91c3042ac955d7f6987f5635f5a765 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Tue, 4 Apr 2017 20:16:14 -0400 Subject: [PATCH] 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. --- app/controllers/remote_follow_controller.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/remote_follow_controller.rb b/app/controllers/remote_follow_controller.rb index 7d4bfe6cee..1e3f786ec8 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